IsElementValidator implements Validator<Object> { @Override public boolean validate(final Object object) { return object instanceof Element; }  @Override boolean validate(final Object object);  }
@Test public void shouldValidateWhenEntity() { final Element element = new Entity.Builder() .group(TestGroups.ENTITY) .build(); final boolean valid = new IsElementValidator().validate(element); assertTrue(valid); }
@Test public void shouldValidateWhenEdge() { final Element element = new Edge.Builder() .group(TestGroups.EDGE) .build(); final boolean valid = new IsElementValidator().validate(element); assertTrue(valid); }
@Test public void shouldNotValidateWhenNotElement() { final Object element = TestGroups.EDGE; final boolean valid = new IsElementValidator().validate(element); assertFalse(valid); }