class SimpleTypeUtil {

    private SimpleTypeUtil() {}

    /**
     * Creates a full name for the specified class in the specified file,
     * suitable to be used as a TypeName.
     * 
     * @param file   the file to reference
     * @param clazz  the class to reference
     * @return       the full name of the class
     */
    public static String nameOf(File file, ClassOrInterface<?> clazz) {
        return Formatting.fileToClassName(file.getName())
            .flatMap(Formatting::packageName)
            .orElseThrow(
                () -> new RuntimeException(
                    "File did not have appropriate name."
                )
            ) + "." + pathTo(file, clazz.getName());
    }
    
    private static String pathTo(HasClasses<?> parent, String needle) {
        return pathTo(parent, "", needle).orElseThrow(() -> new RuntimeException(
            "No class '" + needle + "' found in parent '" + parent + "'."
        ));
    }
    
    private static Optional<String> pathTo(HasClasses<?> parent, String path, String needle) {<FILL_FUNCTION_BODY>}

}

        for (final ClassOrInterface<?> child : parent.getClasses()) {
            final String childName = child.getName();
            final String newPath = path.isEmpty() ? "" : path + "." + childName;
            
            if (childName.equals(needle)) {
                return Optional.of(newPath);
            } else {
                final Optional<String> recursion = pathTo(child, newPath, needle);
                if (recursion.isPresent()) {
                    return recursion;
                }
            }
        }
        
        return Optional.empty();
    
<no_super_class>