UriTemplateHelper implements Serializable { public static List<String> variableNamesFrom(final String uriTemplate) { final List<String> variableNames = new ArrayList<>(); Matcher m = NAMES_PATTERN.matcher(uriTemplate); while (m.find()) { String match = m.group(1); String[] parts = match.split(","); for (final String part : parts) { int colonIdx = part.indexOf(':'); if (colonIdx == -1) { variableNames.add(part); } else { if (colonIdx + 1 == part.length()) { throw new IllegalArgumentException("No custom regular expression specified after ':' in \"" + part + "\""); } variableNames.add(part.substring(0, colonIdx)); } } } return variableNames; }  static List<String> variableNamesFrom(final String uriTemplate);  }
@Test public void testVariableNamesFrom() { assertEquals(variableNamesFrom("http: assertEquals(variableNamesFrom("http: assertEquals(variableNamesFrom("http: assertEquals(variableNamesFrom("http: assertEquals(variableNamesFrom("http: assertEquals(variableNamesFrom("http: assertEquals(variableNamesFrom("http: assertEquals(variableNamesFrom("http: assertEquals(variableNamesFrom("http: assertEquals(variableNamesFrom("http: assertEquals(variableNamesFrom("http: assertEquals(variableNamesFrom("http: assertEquals(variableNamesFrom("http: assertEquals(variableNamesFrom("http: }