### Question:
RecordType extends AbstractType { public boolean isAssignableValue(Object source) { if (source == null) { return true; } if (source instanceof TypedMap) { return this.equals(((TypedMap) source).getType()); } if (source instanceof Map) { for (Entry<?, ?> entry : ((Map<?, ?>) source).entrySet()) { if ((entry.getKey() instanceof String) == false) { return false; } String fieldName = (String) entry.getKey(); if (getFieldType(fieldName).isAssignableValue(entry.getValue()) == false) { return false; } } return true; } return false; } RecordType();  RecordType(final String id, final String name);  RecordType(final String id, final String name,
            final Map<String, Type> fieldTypes); Map<String, Type> getFieldTypes(); void setFieldTypes(Map<String, Type> fieldTypes); Type getFieldType(final String fieldName); @SuppressWarnings("unchecked") Object convertToTypedObject(final Object source); boolean isAssignableValue(Object source); @Override boolean isValid();  }### Answer:
@Test public void testIsAssignableValue() throws Exception { final Map<String, Object> valueA1 = new HashMap<String, Object>() {{ put("a", "valueA"); put("b", 1); }}; final Map<String, Object> valueA2 = new HashMap<String, Object>() {{ put("a", "valueA"); }}; final Map<String, Object> valueA3 = new HashMap<String, Object>() {{ put("a", "valueA"); put("c", true); }}; assertTrue(recordTypeA.isAssignableValue(valueA1)); assertTrue(recordTypeA.isAssignableValue(valueA2)); try { recordTypeA.isAssignableValue(valueA3); fail(); } catch (NoSuchRecordFieldException e) { } final Map<String, Object> valueB1 = new HashMap<String, Object>() {{ put("c", true); put("d", new String[] { "x", "y", "z" }); }}; final Map<String, Object> valueB2 = new HashMap<String, Object>() {{ put("c", true); put("d", new String[] {}); }}; final Map<String, Object> valueB3 = new HashMap<String, Object>() {{ put("c", true); put("d", null); }}; assertTrue(recordTypeB.isAssignableValue(valueB1)); assertTrue(recordTypeB.isAssignableValue(valueB2)); assertTrue(recordTypeB.isAssignableValue(valueB3)); final Map<String, Object> valueC1 = new HashMap<String, Object>() {{ put("e", valueA1); put("f", Calendar.getInstance()); }}; final Map<String, Object> valueC2 = new HashMap<String, Object>() {{ put("e", valueB1); put("f", Calendar.getInstance()); }}; assertTrue(recordTypeC.isAssignableValue(valueC1)); try { recordTypeC.isAssignableValue(valueC2); fail(); } catch (NoSuchRecordFieldException e) { } }