### Question:
GameObjectInstanceRemovedFromSceneCondition implements Condition { @Override public Map<String, Object> serialize() { Map<String, Object> theResult = new HashMap<>(); theResult.put(TYPE_ATTRIBUTE, TYPE_VALUE); GameObject theObject = gameObject.get(); if (theObject != null) { theResult.put("objectUUID", theObject.uuidProperty().get()); } return theResult; } @UsedByReflection  GameObjectInstanceRemovedFromSceneCondition(); Property<GameObject> gameObjectProperty(); @Override ConditionResult appliesTo(GameScene aScene, GameEvent aEvent); @Override Map<String, Object> serialize(); static GameObjectInstanceRemovedFromSceneCondition unmarshall(GameScene aGameScene, Map<String, Object> aSerializedData); static final String GAME_OBJECT_PROPERTY; }### Answer:
@Test public void testSerialize() throws Exception { GameObjectInstanceRemovedFromSceneCondition theCondition = new GameObjectInstanceRemovedFromSceneCondition(); Map<String, Object> theData = theCondition.serialize(); assertEquals(1, theData.size()); assertEquals(GameObjectInstanceRemovedFromSceneCondition.TYPE_VALUE, theData.get(GameObjectInstanceRemovedFromSceneCondition.TYPE_ATTRIBUTE)); GameObject theObject = mock(GameObject.class); Property theUUIDProperty = mock(Property.class); when(theUUIDProperty.get()).thenReturn("UUID"); when(theObject.uuidProperty()).thenReturn(theUUIDProperty); theCondition.gameObjectProperty().set(theObject); Map<String, Object> theData2 = theCondition.serialize(); assertEquals(2, theData2.size()); assertEquals(GameObjectInstanceRemovedFromSceneCondition.TYPE_VALUE, theData2.get(GameObjectInstanceRemovedFromSceneCondition.TYPE_ATTRIBUTE)); assertEquals("UUID", theData2.get("objectUUID")); }