KeyParser { public static List<ConfigurationKeyPart> parse(String raw) { return parse(raw, null); } private  KeyParser(); static List<ConfigurationKeyPart> parse(String raw); static List<ConfigurationKeyPart> parse(String raw, Map<String, String> contextOverrides);  }
@Test public void runTests() { for ( String[] spec : tests ) { List<ConfigurationKeyPart> parts = KeyParser.parse(spec[0]); Assert.assertEquals(Arrays.toString(spec), parts.size(), (spec.length - 1) / 2); for ( int i = 1; (i + 1) < spec.length; i += 2 ) { ConfigurationKeyPart thisPart = parts.get((i - 1) / 2); boolean isVariable = spec[i].equals(VARIABLE); Assert.assertEquals(Arrays.toString(spec) + " : index " + i, isVariable, thisPart.isVariable()); Assert.assertEquals(Arrays.toString(spec) + " : index " + i, spec[i + 1], thisPart.getValue()); } } }