### Question:
StructValue extends HashMap<Field, Object> implements Iterable<Map.Entry<Field, Object>> { public void checkType( Type expectedType ) { if (!isType( expectedType )) throw new IllegalArgumentException(); } StructValue( Type type, ValueFactory vf );  StructValue( Type type, ValueFactory vf, int length ); Type type(); Level level(); boolean isType( Type otherType ); void checkType( Type expectedType ); final Iterator<Map.Entry<Field, Object>> iterator(); @Override final Object put( Field key, Object value ); @Override String toString();  }### Answer:
@Test public void checkType1() { new StructValue( mt1, vf ).checkType( mt1 ); new StructValue( mt2, vf ).checkType( mt2 ); }
@Test( expected = IllegalArgumentException.class ) public void checkType2() { new StructValue( mt1, vf ).checkType( mt2 ); }
@Test( expected = IllegalArgumentException.class ) public void checkType() { new StructValue( mt2, vf ).checkType( mt1 ); }