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