@Test @SuppressWarnings("unchecked") public void testAcceptsNoOp() { when(context.getCandidates()).thenReturn(Collections.emptyList()); assertTrue(tested.accepts(RULE_NO_LIMIT, context)); }
@Override @SuppressWarnings("unchecked") public boolean accepts(final Occurrences rule, final ElementCardinalityContext context) { final Collection<Element<? extends View<?>>> candidates = context.getCandidates(); return candidates.isEmpty() || candidates.stream().anyMatch(candidate -> accepts(rule, context, candidate)); }
ElementCardinalityEvaluationHandler implements RuleEvaluationHandler<Occurrences, ElementCardinalityContext> { @Override @SuppressWarnings("unchecked") public boolean accepts(final Occurrences rule, final ElementCardinalityContext context) { final Collection<Element<? extends View<?>>> candidates = context.getCandidates(); return candidates.isEmpty() || candidates.stream().anyMatch(candidate -> accepts(rule, context, candidate)); } }
ElementCardinalityEvaluationHandler implements RuleEvaluationHandler<Occurrences, ElementCardinalityContext> { @Override @SuppressWarnings("unchecked") public boolean accepts(final Occurrences rule, final ElementCardinalityContext context) { final Collection<Element<? extends View<?>>> candidates = context.getCandidates(); return candidates.isEmpty() || candidates.stream().anyMatch(candidate -> accepts(rule, context, candidate)); } protected  ElementCardinalityEvaluationHandler(); @Inject  ElementCardinalityEvaluationHandler(final DefinitionManager definitionManager,
                                               final CardinalityEvaluationHandler cardinalityEvaluationHandler); }
ElementCardinalityEvaluationHandler implements RuleEvaluationHandler<Occurrences, ElementCardinalityContext> { @Override @SuppressWarnings("unchecked") public boolean accepts(final Occurrences rule, final ElementCardinalityContext context) { final Collection<Element<? extends View<?>>> candidates = context.getCandidates(); return candidates.isEmpty() || candidates.stream().anyMatch(candidate -> accepts(rule, context, candidate)); } protected  ElementCardinalityEvaluationHandler(); @Inject  ElementCardinalityEvaluationHandler(final DefinitionManager definitionManager,
                                               final CardinalityEvaluationHandler cardinalityEvaluationHandler); @Override Class<Occurrences> getRuleType(); @Override Class<ElementCardinalityContext> getContextType(); @Override @SuppressWarnings("unchecked") boolean accepts(final Occurrences rule,
                           final ElementCardinalityContext context); @Override @SuppressWarnings("unchecked") RuleViolations evaluate(final Occurrences rule,
                                   final ElementCardinalityContext context); }
ElementCardinalityEvaluationHandler implements RuleEvaluationHandler<Occurrences, ElementCardinalityContext> { @Override @SuppressWarnings("unchecked") public boolean accepts(final Occurrences rule, final ElementCardinalityContext context) { final Collection<Element<? extends View<?>>> candidates = context.getCandidates(); return candidates.isEmpty() || candidates.stream().anyMatch(candidate -> accepts(rule, context, candidate)); } protected  ElementCardinalityEvaluationHandler(); @Inject  ElementCardinalityEvaluationHandler(final DefinitionManager definitionManager,
                                               final CardinalityEvaluationHandler cardinalityEvaluationHandler); @Override Class<Occurrences> getRuleType(); @Override Class<ElementCardinalityContext> getContextType(); @Override @SuppressWarnings("unchecked") boolean accepts(final Occurrences rule,
                           final ElementCardinalityContext context); @Override @SuppressWarnings("unchecked") RuleViolations evaluate(final Occurrences rule,
                                   final ElementCardinalityContext context);  }