### Question:
Arrays { public static <T> void fill(T[] array, T value) { for (int i = 0; i < array.length; i++) { array[i] = value; } } private  Arrays(); static int binarySearch(T[] array, T object, Comparator<T> comparator); static int binarySearch(T[] array, int startIndex, int endIndex, T object, Comparator<T> comparator); static void fill(T[] array, T value); static void fill(T[] array, int start, int end, T value); static int hashCode(T[] array); static boolean equals(T[] array1, T[] array2); static void sort(T[] array, int start, int end, Comparator<T> comparator); static void sort(T[] array, Comparator<T> comparator); static String toString(T[] array);  }### Answer:
@Test public void test_fill_Ljava_lang_ObjectLjava_lang_Object() { Object val = new Object(); Object[] d = new Object[1000]; Arrays.fill(d, 0, d.length, val); for (int i = 0; i < d.length; i++) assertTrue("Failed to fill Object array correctly", d[i] == val); }
@Test public void test_fill_Ljava_lang_ObjectIILjava_lang_Object() { Object val = new Object(); Object[] d = new Object[1000]; Arrays.fill(d, 400, d.length, val); for (int i = 0; i < 400; i++) assertTrue("Filled elements not in range", !(d[i] == val)); for (int i = 400; i < d.length; i++) assertTrue("Failed to fill Object array correctly", d[i] == val); Arrays.fill(d, 400, d.length, null); for (int i = 400; i < d.length; i++) assertNull("Failed to fill Object array correctly with nulls", d[i]); }