Assume that bands is an ArrayList of String objects, which c…

Assume that bands is an ArrayList of String objects, which contains a number of elements in ascending order. Select a statement to complete the code segment below, which invokes the Java library binarySearch method to search for the string “Beatles”.  If the list does not already contain the string, it should be inserted in an appropriate location so that the list remains sorted. int index = Collections.binarySearch(bands, “Beatles”); if (index < 0) { __________________________ }

The method below is designed to return the smaller of two Co…

The method below is designed to return the smaller of two Comparable objects received as arguments. Assume that the objects are instances of the same class. Select the correct expression to complete the method. public static Comparable smaller(Comparable value1, Comparable value2) { if (_________________________ ) return value1; else return value2); }