private static void pruneCollectionShapes(ServiceModel serviceModel) {
        Map<String, Shape> shapes = copy(serviceModel.getShapes());
        serviceModel.getShapes().forEach((shapeName, shape) -> {
            if (isCollectionOfPrunedShape(shape, shapes)) {
                shapes.remove(shapeName);
                log("Pruned collection-shape [%s]", shapeName);
            }
        });
        serviceModel.setShapes(shapes);
    }
Prune collection shapes (lists and maps) that target pruned shapes as their member type.
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/customization/processors/PruneUnsupportedShapesProcessor.java