@Test public void doesNotFilterListOrMapMembers() { ShapeId stringShapeId = ShapeId.from("ns.foo#StringShape"); StringShape string = StringShape.builder().id(stringShapeId).build(); MemberShape listMember = MemberShape.builder().id("ns.foo#List$member").target(stringShapeId).build(); ListShape list = ListShape.builder().id("ns.foo#List").member(listMember).build(); MemberShape mapKey = MemberShape.builder().id("ns.foo#Map$key").target(stringShapeId).build(); MemberShape mapValue = MemberShape.builder().id("ns.foo#Map$value").target(stringShapeId).build(); MapShape map = MapShape.builder().id("ns.foo#Map").key(mapKey).value(mapValue).build(); Model model = Model.builder() .addShapes(string, list, listMember, map, mapKey, mapValue) .build(); Model result = ModelTransformer.create().filterShapes(model, shape -> !shape.isMemberShape()); assertThat(result.shapes().count(), Matchers.is(6L)); }
FilterShapes(Predicate<Shape> predicate) { this.predicate = predicate .or(shape -> Prelude.isPreludeShape(shape.getId())); }
FilterShapes { FilterShapes(Predicate<Shape> predicate) { this.predicate = predicate .or(shape -> Prelude.isPreludeShape(shape.getId())); } }
FilterShapes { FilterShapes(Predicate<Shape> predicate) { this.predicate = predicate .or(shape -> Prelude.isPreludeShape(shape.getId())); } FilterShapes(Predicate<Shape> predicate); }
FilterShapes { FilterShapes(Predicate<Shape> predicate) { this.predicate = predicate .or(shape -> Prelude.isPreludeShape(shape.getId())); } FilterShapes(Predicate<Shape> predicate);  }
FilterShapes { FilterShapes(Predicate<Shape> predicate) { this.predicate = predicate .or(shape -> Prelude.isPreludeShape(shape.getId())); } FilterShapes(Predicate<Shape> predicate);   }