code: static <T> T doWithMainClasses(File rootFolder, ClassNameCallback<T> callback)
              throws IOException {
          if (!rootFolder.exists()) {
              return null; // nothing to do
          }
          if (!rootFolder.isDirectory()) {
              throw new IllegalArgumentException(
                      "Invalid root folder '" + rootFolder + "'");
          }
          String prefix = rootFolder.getAbsolutePath() + "/";
          Deque<File> stack = new ArrayDeque<File>();
          stack.push(rootFolder);
          while (!stack.isEmpty()) {
              File file = stack.pop();
              if (file.isFile()) {
                  InputStream inputStream = new FileInputStream(file);
                  try {
                      if (isMainClass(inputStream)) {
                          String className = convertToClassName(file.getAbsolutePath(),
                                  prefix);
                          T result = callback.doWith(className);
                          if (result != null) {
                              return result;
                          }
                      }
                  } finally {
                      inputStream.close();
                  }
              }
              if (file.isDirectory()) {
                  pushAllSorted(stack, file.listFiles(PACKAGE_FOLDER_FILTER));
                  pushAllSorted(stack, file.listFiles(CLASS_FILE_FILTER));
              }
          }
          return null;
      }
docs: Perform the given callback operation on all main classes from the given root
  folder.
  
  @param <T>        the result type
  @param rootFolder the root folder
  @param callback   the callback
  @return the first callback result or {@code null}
  @throws IOException in case of I/O errors