LogicalNode extends SuperNode { @Override public void accept(final PredicateVisitor predicateVisitor) { predicateVisitor.visit(this); } LogicalNode(final String name);  LogicalNode(final Type type);  LogicalNode(final Type type, final Node... subNodes);  LogicalNode(final Type type, final Collection<Node> subNodes); String getName(); Type getType(); @Override void accept(final PredicateVisitor predicateVisitor); @Override String toString(); @SuppressWarnings("squid:S109") @Override int hashCode(); @SuppressWarnings("squid:MethodCyclomaticComplexity") @Override boolean equals(final Object obj);  }
@Test public void visitorGetsVisited() { final PredicateVisitor visitorMock = mock(PredicateVisitor.class); final LogicalNode logicalNode = new LogicalNode(LogicalNode.Type.AND); logicalNode.accept(visitorMock); verify(visitorMock).visit(logicalNode); }