### Question:
BatchingTokenRepository implements ToIntFunction<Object>, Closeable { public long[] getOrCreateIds( String[] names ) { return getOrCreateIds( names, names.length ); } BatchingTokenRepository( TokenStore<RECORD> store, Loader<RECORD,Void> loader ); int getOrCreateId( String name ); int getOrCreateId( Object key ); @Override int applyAsInt( Object key ); long[] getOrCreateIds( String[] names ); long[] getOrCreateIds( String[] names, int length ); int getHighId(); @Override void close(); void flush();  }### Answer:
@Test public void shouldDedupLabelIds() { BatchingLabelTokenRepository repo = new BatchingLabelTokenRepository( mock( TokenStore.class ) ); long[] ids = repo.getOrCreateIds( new String[] {"One", "Two", "One"} ); assertTrue( NodeLabelsField.isSane( ids ) ); }