@Override public <V> boolean match(final MatcherContext<V> context) { final boolean condition = inner == null ? context.getMatcher().match(context) : inner.match(context); if (!condition) return false; if (errorIndex < context.getCurrentIndex() && notTestNot(context)) errorIndex = context.getCurrentIndex(); return true; }
private static boolean notTestNot(final MatcherContext<?> context) { if (context.getMatcher() instanceof TestNotMatcher) return false; return context.getParent() == null || notTestNot(context.getParent()); }