ConfigKey implements Comparable<ConfigKey<?>> { public String getConfigId() { return configId; } ConfigKey(String name, String configIdString, String namespace);  ConfigKey(Class<CONFIGCLASS> clazz, String configIdString);  ConfigKey(String name, String configIdString, String namespace, String defMd5, Class<CONFIGCLASS> clazz); @Override int compareTo(ConfigKey<?> o); boolean equals(Object o); int hashCode(); String getName(); String getConfigId(); String getNamespace(); Class<CONFIGCLASS> getConfigClass(); String getMd5(); String toString(); static ConfigKey<?> createFull(String name, String configId, String namespace, String md5);  }
@Test public void testConfigId() { String namespace = "bar"; ConfigKey<?> key1 = new ConfigKey<>("foo", "a/b/c", namespace); ConfigKey<?> key2 = new ConfigKey<>("foo", "a/b/c", namespace); assertEquals(key1, key2); ConfigKey<?> key3 = new ConfigKey<>("foo", "a/b/c/d", namespace); assertNotEquals(key1, key3); assertEquals("a/b/c", new ConfigKey<>("foo", "a/b/c", namespace).getConfigId()); assertEquals("a", new ConfigKey<>("foo", "a", namespace).getConfigId()); assertEquals("", new ConfigKey<>("foo", "", namespace).getConfigId()); assertEquals(key1, key1); assertNotEquals(key1, key3); assertNotEquals(key1, new Object()); ConfigKey<?> key4 = new ConfigKey<>("myConfig", null, namespace); assertEquals("", key4.getConfigId()); }