public static void doTest(@NotNull final CodeInsightTestFixture fixture) {
    final List<CaretPositionInfo> caretPositions =
        DartTestUtils.extractPositionMarkers(
            fixture.getProject(), fixture.getEditor().getDocument());

    fixture.doHighlighting();

    for (CaretPositionInfo caretPositionInfo : caretPositions) {
      final int line =
          fixture.getEditor().getDocument().getLineNumber(caretPositionInfo.caretOffset);
      final int column =
          caretPositionInfo.caretOffset
              - fixture.getEditor().getDocument().getLineStartOffset(line);
      final String fileNameAndPosition =
          fixture.getFile().getName() + ":" + (line + 1) + ":" + (column + 1);

      final PsiReference reference =
          TargetElementUtil.findReference(fixture.getEditor(), caretPositionInfo.caretOffset);
      assertNotNull("No reference in " + fileNameAndPosition, reference);

      final PsiElement resolve = reference.resolve();
      final String actualElementPosition = getPresentableElementPosition(fixture, resolve);
      assertEquals(
          "Incorrect resolution for reference in " + fileNameAndPosition,
          caretPositionInfo.expected,
          actualElementPosition);
    }
  }
  @Override
  public void setUp() throws Exception {
    super.setUp();
    final TestFixtureBuilder<IdeaProjectTestFixture> projectBuilder =
        IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getName());

    myFixture =
        JavaTestFixtureFactory.getFixtureFactory()
            .createCodeInsightFixture(projectBuilder.getFixture());
    final String dataPath = PathManagerEx.getTestDataPath() + "/codeInsight/externalAnnotations";
    myFixture.setTestDataPath(dataPath);
    final JavaModuleFixtureBuilder builder =
        projectBuilder.addModule(JavaModuleFixtureBuilder.class);
    builder.setMockJdkLevel(JavaModuleFixtureBuilder.MockJdkLevel.jdk15);

    myFixture.setUp();
    myModule = builder.getFixture().getModule();
    myProject = myFixture.getProject();
  }
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
    final TestFixtureBuilder<IdeaProjectTestFixture> builder =
        fixtureFactory.createFixtureBuilder(getName());

    myFixture = fixtureFactory.createCodeInsightFixture(builder.getFixture());
    myFixture.setTestDataPath(getTestDataPath());
    myFixture.setUp();

    final Project project = myFixture.getProject();

    new WriteCommandAction(project) {
      @Override
      protected void run(Result result) throws Throwable {
        FileTypeManager.getInstance()
            .registerFileType(RegExpFileType.INSTANCE, new String[] {"regexp"});
      }
    }.execute();
  }
 protected Project getProject() {
   return myFixture.getProject();
 }