@Nullable
  @Contract("null -> null")
  public static DuplocatorState getDuplocatorState(PsiFragment frag) {
    if (frag == null) {
      return null;
    }
    final Language language = frag.getLanguage();
    if (language == null) {
      return null;
    }

    final DuplicatesProfile profile = DuplicatesProfile.findProfileForLanguage(language);
    return profile != null
           ? profile.getDuplocatorState(language)
           : null;
  }
@Nullable
  @Contract("null -> null")
  public static DuplocatorState getDuplocatorState(PsiFragment frag)