### Question:
FreeIdFilteredIdGeneratorFactory implements IdGeneratorFactory { @Override public IdGenerator open( File filename, IdType idType, LongSupplier highId, long maxId ) { FreeIdFilteredIdGenerator freeIdFilteredIdGenerator = new FreeIdFilteredIdGenerator( delegate.open( filename, idType, highId, maxId ), freeIdCondition ); delegatedGenerator.put( idType, freeIdFilteredIdGenerator ); return freeIdFilteredIdGenerator; } FreeIdFilteredIdGeneratorFactory( IdGeneratorFactory delegate, BooleanSupplier freeIdCondition ); @Override IdGenerator open( File filename, IdType idType, LongSupplier highId, long maxId ); @Override IdGenerator open( File filename, int grabSize, IdType idType, LongSupplier highId, long maxId ); @Override void create( File filename, long highId, boolean throwIfFileExists ); @Override IdGenerator get( IdType idType );  }### Answer:
@Test public void openFilteredGenerator() { FreeIdFilteredIdGeneratorFactory filteredGenerator = createFilteredFactory(); IdType idType = IdType.NODE; long highId = 1L; long maxId = 10L; LongSupplier highIdSupplier = () -> highId; IdGenerator idGenerator = filteredGenerator.open( file, idType, highIdSupplier, maxId ); verify( idGeneratorFactory ).open( eq( file ), eq( idType ), any( LongSupplier.class ), eq( maxId ) ); assertThat( idGenerator, instanceOf( FreeIdFilteredIdGenerator.class ) ); }
@Test public void openFilteredGeneratorWithGrabSize() { FreeIdFilteredIdGeneratorFactory filteredGenerator = createFilteredFactory(); IdType idType = IdType.NODE; long highId = 1L; long maxId = 10L; int grabSize = 5; LongSupplier highIdSupplier = () -> highId; IdGenerator idGenerator = filteredGenerator.open( file, grabSize, idType, highIdSupplier, maxId ); verify( idGeneratorFactory ).open( file, grabSize, idType, highIdSupplier, maxId ); assertThat( idGenerator, instanceOf( FreeIdFilteredIdGenerator.class ) ); }