### Question:
DefaultToSoyDataConverter implements ToSoyDataConverter { protected SoyMapData objectToSoyDataMap(Object obj) throws Exception { if (obj == null) { return new SoyMapData(); } if (obj instanceof SoyMapData) { return (SoyMapData) obj; } return new SoyMapData(toSoyCompatibleMap(obj)); } DefaultToSoyDataConverter(); void setIgnorablePropertiesMatcher(
			Matcher<PropertyDescriptor> ignorablePropertiesMatcher); @Override Optional<SoyMapData> toSoyMap(final Object model);  }### Answer:
@Test public void testObjectToSoyDataMapWhenObjectIsNull() throws Exception { SoyMapData testObject = objectToSoyDataConverter .objectToSoyDataMap(null); assertTrue(testObject instanceof SoyMapData); }
@Test public void testObjectToSoyDataMapWhenObjectIsSoyMapData() throws Exception { SoyMapData testInput = new SoyMapData(); testInput.putSingle(key, SoyData.createFromExistingData(keyValue)); SoyMapData testObject = objectToSoyDataConverter .objectToSoyDataMap(testInput); assertTrue(testObject instanceof SoyMapData); assertEquals(keyValue, ((SoyMapData) testObject).get(key).stringValue()); }
@Test public void testObjectToSoyDataMapWhenObjectIsMap() throws Exception { Map<String, String> testInput = new HashMap<String, String>(); testInput.put(key, keyValue); SoyMapData testObject = objectToSoyDataConverter .objectToSoyDataMap(testInput); assertTrue(testObject instanceof SoyMapData); assertEquals(keyValue, ((SoyMapData) testObject).get(key).stringValue()); }