### Question:
StateMachine implements IStateMachine { @Override public void allocateNewSyncStateWithoutTracking(UserDataRequest udr, CollectionId collectionId, Date lastSync, SyncKey newSyncKey) throws DaoException, InvalidServerId { ItemSyncState newState = collectionDao.updateState(udr.getDevice(), collectionId, newSyncKey, lastSync); log(udr, newState); } @Inject @VisibleForTesting  StateMachine(CollectionDao collectionDao, ItemTrackingDao itemTrackingDao); @Override ItemSyncState lastKnownState(Device device, CollectionId collectionId); @Override ItemSyncState getItemSyncState(SyncKey syncKey); @Override void allocateNewSyncState(UserDataRequest udr, CollectionId collectionId, Date lastSync, SyncCollectionResponse syncCollectionResponse, SyncKey newSyncKey); @Override void allocateNewSyncStateWithoutTracking(UserDataRequest udr, CollectionId collectionId, Date lastSync, SyncKey newSyncKey);  }### Answer:
@Test public void allocateNewSyncStateWithoutTrackingShouldStoreUpdatedState() throws Exception { CollectionId collectionId = CollectionId.of(1); Date lastSync = DateUtils.getCurrentDate(); SyncKey newSyncKey = new SyncKey("a1fa04d6-ba8b-4a9a-9529-1d0bb7a359b1"); CollectionDao collectionDao = control.createMock(CollectionDao.class); expect(collectionDao.updateState(device, CollectionId.of(1), newSyncKey, lastSync)) .andReturn(ItemSyncState.builder() .syncKey(newSyncKey) .syncDate(lastSync) .build()); control.replay(); StateMachine stateMachine = new StateMachine(collectionDao , null); stateMachine.allocateNewSyncStateWithoutTracking(udr, collectionId, lastSync, newSyncKey); control.verify(); }