private static boolean isSourceFolder(@NotNull SourceFolder folder) {
    final JpsModuleSourceRoot sourceRoot = folder.getJpsElement();
    if (sourceRoot.getRootType() != SOURCE) return false;
    if (!(sourceRoot.getProperties() instanceof JavaSourceRootProperties javaProperties)) return false;
    return !javaProperties.isForGeneratedSources();
  }
private static boolean isSourceFolder(@NotNull SourceFolder folder)