public List < Command > removeFromMap ( final UUID mapId , final Object key ) { final State state = createCommandList ( new WithCommandType ( ) { @ Override public void invoke ( final State state ) { createObservableObject ( key , state ) ; } } , false ) ; final boolean keyIsObservableObject = state . lastObjectWasObservable ; final RemoveFromMap msg = new RemoveFromMap ( ) ; msg . setMapId ( mapId ) ; msg . setKey ( valueMapper . map ( key , keyIsObservableObject ) ) ; state . commands . add ( state . commands . size ( ) - 1 , msg ) ; return state . commands ; }
Creates the list with command necessary to remove a mapping from a map .