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