public boolean isInLibraryClasses(final Project project, final VirtualFile file) {
    final ProjectFileIndex projectFileIndex = ProjectRootManager.getInstance(project).getFileIndex();

    return ReadAction.compute(() -> projectFileIndex.isInLibraryClasses(file) && !projectFileIndex.isInSource(file));
  }
public boolean isInLibraryClasses(final Project project, final VirtualFile file)