AbstractIdentifierMap implements IdentifierMap { @Override public Long2ObjectMap<ValueSpecification> getValueSpecifications(final LongCollection identifiers) { return getValueSpecifications(this, identifiers); }  @Override Object2LongMap<ValueSpecification> getIdentifiers(final Collection<ValueSpecification> specifications); static Object2LongMap<ValueSpecification> getIdentifiers(final IdentifierMap map, final Collection<ValueSpecification> specifications); @Override Long2ObjectMap<ValueSpecification> getValueSpecifications(final LongCollection identifiers); static Long2ObjectMap<ValueSpecification> getValueSpecifications(final IdentifierMap map, final LongCollection identifiers); static void convertIdentifiers(final IdentifierMap map, final IdentifierEncodedValueSpecifications object); static void resolveIdentifiers(final IdentifierMap map, final IdentifierEncodedValueSpecifications object);  }
@Test public void simpleOperation() throws IOException { IdentifierMap idMap = createIdentifierMap("simpleOperation"); Map<String, Long> identifiers = new HashMap<String, Long>(); LongSet seenIdentifiers = new LongOpenHashSet(); for (int i = 0; i < 10; i++) { String valueName = "value-" + i; ValueSpecification valueSpec = getValueSpec(valueName); long identifier = idMap.getIdentifier(valueSpec); assertFalse(seenIdentifiers.contains(identifier)); seenIdentifiers.add(identifier); identifiers.put(valueName, identifier); } for (int j = 0; j < 5; j++) { Long2ObjectMap<ValueSpecification> valueSpecs = idMap.getValueSpecifications(seenIdentifiers); assertEquals(seenIdentifiers.size(), valueSpecs.size()); for (int i = 0; i < 10; i++) { String valueName = "value-" + i; ValueSpecification valueSpec = getValueSpec(valueName); long identifier = idMap.getIdentifier(valueSpec); long existingIdentifier = identifiers.get(valueName); assertEquals(identifier, existingIdentifier); assertEquals(valueSpec, idMap.getValueSpecification(identifier)); assertEquals(valueSpec, valueSpecs.get(identifier)); } } stopIdentifierMap(idMap); }