LayerValidator { protected static String[] shiftArray(String[] original) { if (original == null || original.length == 0) { return null; } return Arrays.copyOfRange(original, 1, original.length); }  static Map<String, Map<String, String>> validateLocale(Map<String, Map<String, String>> locale); static String sanitizeUrl(final String url); static String sanitizeUrl(final String url, Set<String> paramsToRemove); static String sanitizeGFIContent(String gfiContent); static Set<String> getMandatoryFields(String type); static Set<String> getRecognizedLayerTypes(); static void validateAndSanitizeLayerInput(MapLayer input);  }
@Test public void testShift() { String path = "testing.like.there's.no.tomorrow"; String[] original = path.split("\\."); String[] rest = LayerValidator.shiftArray(original); for (int i = 1; i < original.length; i++) { assertEquals(original[i], rest[0]); rest = LayerValidator.shiftArray(rest); } assertEquals("Rest should be empty", rest.length, 0); }