MemoryIDMigrator extends AbstractIDMigrator implements UpdatableIDMigrator { @Override public void initialize(Iterable<String> stringIDs) { for (String stringID : stringIDs) { storeMapping(toLongID(stringID), stringID); } } MemoryIDMigrator(); @Override void storeMapping(long longID, String stringID); @Override String toStringID(long longID); @Override void initialize(Iterable<String> stringIDs);  }
@Test public void testInitialize() throws Exception { UpdatableIDMigrator migrator = new MemoryIDMigrator(); long id = migrator.toLongID(DUMMY_STRING); assertNull(migrator.toStringID(id)); migrator.initialize(Collections.singleton(DUMMY_STRING)); assertEquals(DUMMY_STRING, migrator.toStringID(id)); }