@Override
  protected Preference getPreferredCondition(@NotNull final PsiElement position) {
    if (INSIDE_REFERENCE_LIST.accepts(position)) {
      GrReferenceList list = (GrReferenceList)position.getParent().getParent();
      PsiElement parent = list.getParent();
      if (parent instanceof GrTypeDefinition cls) {
        if (cls.isInterface() && list == cls.getExtendsClause() || list == cls.getImplementsClause()) {
          return Preference.Interfaces;
        }
        if (list == cls.getExtendsClause()) {
          return Preference.Classes;
        }
      }
      if (parent instanceof GrMethod && ((GrMethod)parent).getThrowsList() == list) {
        return Preference.Exceptions;
      }
    }

    return null;
  }
@Override
  protected Preference getPreferredCondition(@NotNull final PsiElement position)