### Question:
TypeValidator implements Validator { public boolean validate( Object value ) { if (value == null) return false; Class<?> clss = value.getClass(); if (clss == expectedClass) return true; return subclassOk && expectedClass.isAssignableFrom( clss ); } TypeValidator( Class<?> scalarClass, Class<?> arrayClass, int nDims,
		String descr );  TypeValidator( Class<?> scalarClass, Class<?> arrayClass, int nDims,
		String descr, boolean subclassOk ); final static void checkDims( int nDims ); Class<?> getExpectedClass(); int getNDims(); @Override final String toString(); boolean validate( Object value ); Object validateValue( Object value );  }### Answer:
@Test( expected = IllegalArgumentException.class ) public void testValidate() { new MyTypeValidator( int.class, int.class, -1, "bzzt" ); }