@Override
  public IMarkerResolution[] getResolutions(@Nullable IMarker marker) {
    if (!hasResolutions(marker)) {
      return NO_RESOLUTIONS;
    }
    String markedText = null;
    if (marker != null) {
      markedText = marker.getAttribute(AnnotationManager.MARKED_TEXT, null);
    }

    if (markedText == null) {
      JavaEditor activeEditor = (JavaEditor) getActiveEditor();

      if (activeEditor != null) {
        int caretOffset = activeEditor.getViewer().getTextWidget().getCaretOffset();
        DiagnosticAnnotation annotation = getAnnotationByOffset(caretOffset);
        if (annotation != null) {
          markedText = annotation.getMarkedText();
        }
      }
    }

    if (markedText == null) {
      return NO_RESOLUTIONS;
    }

    Collection<IType> typeResolutions =
        Collections2.filter(
            findAllTypes(markedText),
            new Predicate<IType>() {

              @Override
              public boolean apply(IType type) {
                try {
                  return Flags.isPublic(type.getFlags());
                } catch (JavaModelException e) {
                  KotlinLogger.logAndThrow(e);
                }

                return false;
              }
            });

    List<AutoImportMarkerResolution> markerResolutions =
        new ArrayList<AutoImportMarkerResolution>();
    for (IType type : typeResolutions) {
      markerResolutions.add(new AutoImportMarkerResolution(type));
    }

    return markerResolutions.toArray(new IMarkerResolution[markerResolutions.size()]);
  }