### Question:
Engine { public ScanResult scan(UastNode uast, InputFile inputFile) throws IOException { metricsVisitor.enterFile(uast); engineContext.enterFile(inputFile); visit(uast); return new ScanResult(engineContext.getIssues(), metricsVisitor.getMetrics()); } Engine(Collection<Check> rules);  Engine(Collection<Check> rules, Collection<Validator> validators); ScanResult scan(UastNode uast, InputFile inputFile);  }### Answer:
@Test void visit_should_visit_all_nodes() throws Exception { NodeCounter nodeCounter = new NodeCounter(); Engine engine = new Engine(Collections.singletonList(nodeCounter)); InputFile inputFile = TestInputFileBuilder.create(".", "foo.go").setType(InputFile.Type.MAIN).build(); List<Issue> issues = engine.scan(uast, inputFile).issues; assertEquals(4, issues.size()); assertTrue(issues.stream().map(Issue::getCheck).allMatch(rule -> rule == nodeCounter)); }