ConfigKey implements Comparable<ConfigKey<?>> { public ConfigKey(String name, String configIdString, String namespace) { this(name, configIdString, namespace, null, null); } 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 testConfigKey() { String name = AppConfig.CONFIG_DEF_NAME; String namespace = AppConfig.CONFIG_DEF_NAMESPACE; String md5 = AppConfig.CONFIG_DEF_MD5; String configId = "myId"; ConfigKey<AppConfig> classKey = new ConfigKey<>(AppConfig.class, configId); assertEquals("Name is set correctly from class", name, classKey.getName()); assertEquals("Namespace is set correctly from class", namespace, classKey.getNamespace()); assertEquals(configId, classKey.getConfigId()); assertEquals("Md5 is set correctly from class", md5, classKey.getMd5()); ConfigKey<?> stringKey = new ConfigKey<>(name, configId, namespace); assertEquals("Key created from class equals key created from strings", stringKey, classKey); }