MissingElementViolationPredicate implements ViolationPredicate { @Override public Optional<Boolean> apply(Overlap overlap) { return isMissingElement(overlap) ? Optional.of(true) : Optional.empty(); }  @Override Optional<Boolean> apply(Overlap overlap);  }
@Test public void fullInstance() { Overlap overlap = buildOverlap(buildAUG().withActionNode(":action:")).withNode(":action:").build(); ViolationPredicate strategy = new MissingElementViolationPredicate(); assertFalse(strategy.apply(overlap).isPresent()); }
@Test public void missingNode() { Overlap overlap = buildOverlap(buildAUG().withActionNode(":action:")).build(); MissingElementViolationPredicate strategy = new MissingElementViolationPredicate(); assertTrue(strategy.apply(overlap).orElse(false)); }
@Test public void missingEdge() { final TestAUGBuilder builder = buildAUG().withActionNodes(":a1:", ":a2:").withEdge(":a1:", ORDER, ":a2:"); Overlap overlap = buildOverlap(builder).withNode(":a1:").withNode(":a2:").build(); MissingElementViolationPredicate strategy = new MissingElementViolationPredicate(); assertTrue(strategy.apply(overlap).orElse(false)); }