code: public static List<ClassReference> analyze(WildcardImportResolver importResolver, Set<String> libraryPaths, Set<String> sourcePaths,
                  Path sourceFile)
      {
          ASTParser parser = ASTParser.newParser(AST.JLS11);
          parser.setEnvironment(libraryPaths.toArray(new String[libraryPaths.size()]), sourcePaths.toArray(new String[sourcePaths.size()]), null, true);
          parser.setBindingsRecovery(false);
          parser.setResolveBindings(true);
          Map options = JavaCore.getOptions();
          JavaCore.setComplianceOptions(JavaCore.VERSION_1_8, options);
          parser.setCompilerOptions(options);
          String fileName = sourceFile.getFileName().toString();
          parser.setUnitName(fileName);
          try
          {
              parser.setSource(FileUtils.readFileToString(sourceFile.toFile()).toCharArray());
          }
          catch (IOException e)
          {
              throw new ASTException("Failed to get source for file: " + sourceFile.toString() + " due to: " + e.getMessage(), e);
          }
          parser.setKind(ASTParser.K_COMPILATION_UNIT);
          CompilationUnit cu = (CompilationUnit) parser.createAST(null);
          ReferenceResolvingVisitor visitor = new ReferenceResolvingVisitor(importResolver, cu, sourceFile.toString());
          cu.accept(visitor);
          return visitor.getJavaClassReferences();
      }
docs: Parses the provided file, using the given libraryPaths and sourcePaths as context. The libraries may be either
  jar files or references to directories containing class files.
  
  The sourcePaths must be a reference to the top level directory for sources (eg, for a file
  src/main/java/org/example/Foo.java, the source path would be src/main/java).
  
  The wildcard resolver provides a fallback for processing wildcard imports that the underlying parser was unable
  to resolve.