ExistsNode implements Node { @Override public void accept(PredicateVisitor predicateVisitor) { predicateVisitor.visit(this); } ExistsNode(final String property); String getProperty(); @Override void accept(PredicateVisitor predicateVisitor); @Override @SuppressWarnings("squid:MethodCyclomaticComplexity") boolean equals(final Object o); @Override @SuppressWarnings("squid:S109") int hashCode(); @Override String toString();  }
@Test public void visitorGetsVisited() { final PredicateVisitor visitorMock = mock(PredicateVisitor.class); final ExistsNode existsNode = new ExistsNode("propertyName"); existsNode.accept(visitorMock); verify(visitorMock).visit(existsNode); }