Question: Write a JUnit test class that fully tests the indexOf method below (recursiveBinarySearcher is a helper method to find the indexOf a particular element and
Write a JUnit test class that fully tests the indexOf method below (recursiveBinarySearcher is a helper method to find the "indexOf" a particular element and -1 should be returned if an element is not found).
Here is the code:
import java.util.List; import java.lang.Comparable; import java.util.ArrayList;
public class Sorters2120 {
/** * A method to find the "indexOf" a particular element. * @param searchItem to compare * @param theList to compare * @return position of searched element */ public static
/** * A recursive helper method to find the position of * a specified value within a sorted array. * @param searchItem to compare * @param theList to compare * @param first element to compare * @param last element to compare * @return -1 if the element is not found */ private static
} // End class Sorters2120
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
