UriDecoder { private static List<String> split(final String input, final char c) { List<String> list = new LinkedList<>(); int start = 0; int end; while ((end = input.indexOf(c, start)) >= 0) { list.add(input.substring(start, end)); start = end + 1; } list.add(input.substring(start)); return list; }  static boolean isFormEncoding(); static String decode(final String encoded);  }
@Test public void split() throws Exception { assertEquals(Arrays.asList(""), UriDecoder.splitAndDecodePath("")); assertEquals(Arrays.asList("", ""), UriDecoder.splitAndDecodePath("/")); assertEquals(Arrays.asList("a"), UriDecoder.splitAndDecodePath("a")); assertEquals(Arrays.asList("a", ""), UriDecoder.splitAndDecodePath("a/")); assertEquals(Arrays.asList("", "a"), UriDecoder.splitAndDecodePath("/a")); assertEquals(Arrays.asList("a", "b"), UriDecoder.splitAndDecodePath("a/b")); assertEquals(Arrays.asList("", "a", "b"), UriDecoder.splitAndDecodePath("/a/b")); assertEquals(Arrays.asList("", "a", "", "", "b", ""), UriDecoder.splitAndDecodePath("/a }