@Test
public void testSmartCompletionPrimaryType() throws Exception {

  JavaCompletion completion = getCompletion();
  File file =
      new File(
              project.getProjectRootPath(), "./src/main/java/meghanada/analyze/JavaAnalyzer.java")
          .getCanonicalFile();
  assertTrue(file.exists());
  final Collection<? extends CandidateUnit> units =
      timeIt(() -> completion.completionAt(file, 340, 4, "*code*int#"));
  units.forEach(a -> log.info(a.getDisplayDeclaration()));
  Object[] objs = (units.toArray());
  CandidateUnit unit1 = (CandidateUnit) objs[0];
  CandidateUnit unit2 = (CandidateUnit) objs[1];
  CandidateUnit unit3 = (CandidateUnit) objs[2];
  CandidateUnit unit4 = (CandidateUnit) objs[3];
  assertEquals("codePointAt", unit1.getName());
  assertEquals("codePointBefore", unit2.getName());
  assertEquals("codePointCount", unit3.getName());
  assertEquals("compareTo", unit4.getName());
}