Dddb { static String findOriginalName(Properties mappingProperties, String searchName) { final Set<Map.Entry<Object, Object>> entries = mappingProperties.entrySet(); for (Map.Entry<Object, Object> next : entries) { if (searchName.equalsIgnoreCase((String) next.getValue())) { return (String) next.getKey(); } } return null; } private  Dddb(); static Dddb getInstance(); DataFormat getDataFormat(File hdrFile); BandDescriptor findBandDescriptorForMember(String formatName, String memberName); Family<BandDescriptor> getBandDescriptors(String formatName); Family<FlagDescriptor> getFlagDescriptors(String identifier); Family<MemberDescriptor> getMemberDescriptors(File hdrFile);  }
@Test public void testGetOriginalName() { final Properties properties = new Properties(); properties.setProperty("a_key", "a_value"); properties.setProperty("another_key", "another_value"); final String key = Dddb.findOriginalName(properties, "another_value"); assertEquals("another_key", key); }
@Test public void testGetOriginalName_nameNotInProperties() { final Properties properties = new Properties(); properties.setProperty("a_key", "a_value"); properties.setProperty("another_key", "another_value"); final String key = Dddb.findOriginalName(properties, "the Werner Value"); assertNull(key); }