@Test public void testSetProperty_4args_deniedByFilter() throws Exception { C1 object = new C1(); object.setString1(null); String propertyName = "string1"; Object value = "myStringValue"; Bean instance = new Bean(C1.class); ClassFilter filter = new SimpleClassFilter(C3.class, TypeAnn.class); try { instance.setProperty(object, propertyName, value, filter); } catch (IllegalAccessException ex) { if (ex.getMessage().equals("Property no found")) { // IS OK - it is correct return; } } // Error throw new Exception("No correct - Inncorect result"); }