private static SourceFolder suitableTestSourceFolders()

in android/tooling/rib-intellij-plugin/src/main/java/com/uber/presidio/intellij_plugin/action/rib/GenerateAction.java [58:73]


  private static SourceFolder suitableTestSourceFolders(Project project, Module module) {
    ContentEntry[] contentEntries = ModuleRootManager.getInstance(module).getContentEntries();
    for (ContentEntry contentEntry : contentEntries) {
      List<SourceFolder> testSourceFolders =
          contentEntry.getSourceFolders(JavaSourceRootType.TEST_SOURCE);
      for (SourceFolder testSourceFolder : testSourceFolders) {
        if (testSourceFolder.getFile() != null) {
          if (!JavaProjectRootsUtil.isInGeneratedCode(testSourceFolder.getFile(), project)) {
            return testSourceFolder;
          }
        }
      }
    }

    return null;
  }