### Question:
TypeFieldHandler implements ElementHandler { public boolean handle(Element element) { return clazz.isAssignableFrom(element.getType()); } TypeFieldHandler(Class clazz); boolean handle(Element element);  }### Answer:
@Test public void testHandle() throws Exception { List<Element> fields = TestUtils.getTestFields(); ElementHandler handler = new TypeFieldHandler(StringProperty.class); Assert.assertTrue(handler.handle(fields.get(0))); Assert.assertFalse(handler.handle(fields.get(1))); Assert.assertFalse(handler.handle(fields.get(2))); Assert.assertFalse(handler.handle(fields.get(3))); Assert.assertFalse(handler.handle(fields.get(4))); }