ArrayUtils { public static boolean isIndexOfLastArrayElement(String[] array, int elementIndex) { return elementIndex == array.length - 1; }  static T[] mergeArrays(T[] one, T[] two); static boolean keysPresentInColumns(String[] keys, String[] columns); static String[] convertStringKeyToArray(String keys, String delimiter); static String[] convertStringKeyToArray(String keys); static int[] getCompareColumnsPosition(String[] columns, String[] keyColumns); static List<Integer> getColumnsPosition(String[] columns, String[] keyColumns); static boolean isIndexOfLastArrayElement(String[] array, int elementIndex);  }
@Test public void isIndexOfLastArrayElementShouldReturnFalseWhenIndexIsNotLastArrayElement() throws Exception { String[] array = { "1", "2", "3" }; int notLastElementIndex = 1; assertThat(isIndexOfLastArrayElement(array, notLastElementIndex), is(false)); }
@Test public void isIndexOfLastArrayElementShouldReturnTrueWhenIndexIsLastArrayElement() throws Exception { String[] array = { "1", "2", "3" }; int lastElementIndex = 2; assertThat(isIndexOfLastArrayElement(array, lastElementIndex), is(true)); }