@Contract("null -> true")
  private static boolean methodMayHaveSideEffect(@Nullable PsiMethod method) {
    if (method == null) return true;
    PsiClass psiClass = method.getContainingClass();
    if (psiClass == null) return true;

    String className = psiClass.getQualifiedName();
    if (className == null) {
      return true;
    }

    if (MethodUtils.isEquals(method) ||
        MethodUtils.isHashCode(method) ||
        MethodUtils.isToString(method) ||
        MethodUtils.isCompareTo(method) ||
        MethodUtils.isComparatorCompare(method) ||
        SIDE_EFFECTS_FREE_CLASSES.contains(className)) {
      return false;
    }

    if ("java.util.UUID".equals(className)) {
      return "randomUUID".equals(method.getName());
    }
    if (JAVA_LANG_MATH.equals(className) ||
        JAVA_LANG_STRICT_MATH.equals(className)) {
      return "random".equals(method.getName()); // it's the only exception
    }
    if (JAVA_UTIL_COLLECTIONS.equals(className)) {
      String name = method.getName();
      return !name.equals("min") && !name.equals("max") && !name.startsWith("unmodifiable");
    }
    if ("java.nio.file.Path".equals(className)) {
      return !"of".equals(method.getName());
    }
    if ("java.nio.file.Paths".equals(className)) {
      return !"get".equals(method.getName());
    }
    return true;
  }
@Contract("null -> true")
  private static boolean methodMayHaveSideEffect(@Nullable PsiMethod method)