list has extra values that are not part of a pair, those values are unchanged.

In Java ArrayList, Write a static method called flip2 that takes an ArrayList of Strings as a parameter and then flips each successive pair of values in the list. For example, suppose that a variable called list stores the following sequence of values: [“aa””, “bb””, “cc””, “DDD”, “happy”, “snow”] and we make the following call: flip(list); Afterwards the list should store the following sequence of values: [ “bb””, “aa””, “DDD”, “cc””, “snow”, “happy”] If the list has extra values that are not part of a pair, those values are unchanged. For example, if the list had instead stored: [“aa””, “bb””, “cc””, “DDD”, “happy”, “snow”, “hometown”] The result would have been: [ “bb””, “aa””, “DDD”, “cc””, “snow”, “happy”, “hometown”]