TableScanOperator extends PhysicalPlan { @Override public <R, C> R accept(PhysicalPlanNodeVisitor<R, C> visitor, C context) { return visitor.visitTableScan(this, context); }  @Override R accept(PhysicalPlanNodeVisitor<R, C> visitor, C context); @Override List<PhysicalPlan> getChild();  }
@Test public void accept() { Boolean isVisited = tableScan.accept(new PhysicalPlanNodeVisitor<Boolean, Object>() { @Override protected Boolean visitNode(PhysicalPlan node, Object context) { return (node instanceof TableScanOperator); } @Override public Boolean visitTableScan(TableScanOperator node, Object context) { return super.visitTableScan(node, context); } }, null); assertTrue(isVisited); }