Dddb { static Map<String, BandDescriptor> extractUniqueMembers(List<BandDescriptor> bandDescriptorsList) { final HashMap<String, BandDescriptor> uniqueMemberMap = new HashMap<>(); for (BandDescriptor bandDescriptor : bandDescriptorsList) { final String memberName = bandDescriptor.getMemberName(); if (uniqueMemberMap.containsKey(memberName)) { continue; } uniqueMemberMap.put(memberName, bandDescriptor); } return uniqueMemberMap; } 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 testExtractUniqueMemberNames() { final ArrayList<BandDescriptor> descriptors = new ArrayList<>(); descriptors.add(new TestBandDescriptor("name")); descriptors.add(new TestBandDescriptor("name_2")); descriptors.add(new TestBandDescriptor("name_3")); descriptors.add(new TestBandDescriptor("name_4")); descriptors.add(new TestBandDescriptor("name_2")); descriptors.add(new TestBandDescriptor("name")); final Map<String, BandDescriptor> descriptorMap = Dddb.extractUniqueMembers(descriptors); assertEquals(4, descriptorMap.size()); assertTrue(descriptorMap.containsKey("name")); assertTrue(descriptorMap.containsKey("name_2")); assertTrue(descriptorMap.containsKey("name_3")); assertTrue(descriptorMap.containsKey("name_4")); }