@Test public void yieldsUniqueShapes() { OperationShape readOperation = OperationShape.builder() .id("smithy.example#Read") .build(); ResourceShape resource = ResourceShape.builder() .id("smithy.example#Resource") .read(readOperation.getId()) .build(); Model model = Model.builder().addShapes(readOperation, resource).build(); Walker walker = new Walker(model); List<Shape> shapes = new ArrayList<>(); walker.iterateShapes(resource).forEachRemaining(shapes::add); assertThat(shapes, containsInAnyOrder(readOperation, resource)); }
public Iterator<Shape> iterateShapes(Shape shape) { return iterateShapes(shape, FunctionalUtils.alwaysTrue()); }
Walker { public Iterator<Shape> iterateShapes(Shape shape) { return iterateShapes(shape, FunctionalUtils.alwaysTrue()); } }
Walker { public Iterator<Shape> iterateShapes(Shape shape) { return iterateShapes(shape, FunctionalUtils.alwaysTrue()); } Walker(Model model);  Walker(NeighborProvider provider); }
Walker { public Iterator<Shape> iterateShapes(Shape shape) { return iterateShapes(shape, FunctionalUtils.alwaysTrue()); } Walker(Model model);  Walker(NeighborProvider provider); Set<Shape> walkShapes(Shape shape); Set<Shape> walkShapes(Shape shape, Predicate<Relationship> predicate); Iterator<Shape> iterateShapes(Shape shape); Iterator<Shape> iterateShapes(Shape shape, Predicate<Relationship> predicate); }
Walker { public Iterator<Shape> iterateShapes(Shape shape) { return iterateShapes(shape, FunctionalUtils.alwaysTrue()); } Walker(Model model);  Walker(NeighborProvider provider); Set<Shape> walkShapes(Shape shape); Set<Shape> walkShapes(Shape shape, Predicate<Relationship> predicate); Iterator<Shape> iterateShapes(Shape shape); Iterator<Shape> iterateShapes(Shape shape, Predicate<Relationship> predicate);  }