### Question:
ReplicatedIdAllocationStateMachine implements StateMachine<ReplicatedIdAllocationRequest> { synchronized long firstUnallocated( IdType idType ) { return state().firstUnallocated( idType ); } ReplicatedIdAllocationStateMachine( StateStorage<IdAllocationState> storage ); @Override synchronized void applyCommand( ReplicatedIdAllocationRequest request, long commandIndex,
            Consumer<Result> callback ); @Override void flush(); @Override long lastAppliedIndex(); synchronized IdAllocationState snapshot(); synchronized void installSnapshot( IdAllocationState snapshot );  }### Answer:
@Test public void shouldNotHaveAnyIdsInitially() { ReplicatedIdAllocationStateMachine stateMachine = new ReplicatedIdAllocationStateMachine( new InMemoryStateStorage<>( new IdAllocationState() ) ); assertEquals( 0, stateMachine.firstUnallocated( someType ) ); }