private static void doWhileShapesRemoved(ServiceModel serviceModel, Runnable runnable) {
        int numShapes;
        do {
            numShapes = serviceModel.getShapes().size();
            runnable.run();
        } while (serviceModel.getShapes().size() < numShapes);
    }
Repeatedly invoke the provided {@link Runnable} as long as the {@link ServiceModel}
continues to have {@link Shape}s removed. Running repeatedly allows for a recursive
removal of shapes that point to just-pruned shapes.
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/customization/processors/PruneUnsupportedShapesProcessor.java