private static void takePortraitOf(final Class<?> clazz,
                                       final Map<Class<?>, List<String>> portrait,
                                       final String basePackage) {
        final List<String> methodSignatures = new ArrayList<>();
        final List<Class<?>> classesForRecursion = new ArrayList<>();

        // We don't need to filter by 'public' because `getMethods()` only gets public methods.
        Arrays.stream(clazz.getMethods())
                .forEach(method -> {
                    methodSignatures.add(method.toGenericString());
                    classesForRecursion.addAll(getClassesForRecursion(basePackage, method));
                });

        portrait.put(clazz, methodSignatures);

        // Time to recurse
        classesForRecursion.stream()
                .filter(typeToAnalyse -> !portrait.containsKey(typeToAnalyse))
                .forEach(typeToAnalyse -> takePortraitOf(typeToAnalyse, portrait, basePackage));
    }
Creates a text representation (a 'portrait') of a class's public methods.
<p>
Only recurses over those classes that match a base package.
stroom-query/stroom-query-api/src/test/java/stroom/query/api/current/ClassPhotographer.java