StatisticalMappingAnalyser { public static void sortAlongLength_BiggestFirst(String[] algorithmNames) { Arrays.sort(algorithmNames, new Comparator<String>() { @Override public int compare(String o1, String o2) { return o2.length() - o1.length(); } }); } StatisticalMappingAnalyser(Set<String> fullNames); String[] getStatisticalMeasureNames(); String[] getGeophysicalParameterNames(); static void sortAlongLength_BiggestFirst(String[] algorithmNames);  }
@Test public void testStingSortingAlongLenth() { final String[] strings = {"1", "22", "333", "4444", "55555"}; StatisticalMappingAnalyser.sortAlongLength_BiggestFirst(strings); assertArrayEquals(new String[]{"55555", "4444", "333", "22", "1"}, strings); }