public static boolean isMutableCollection(@NotNull Object object) {
    if (object == Collections.emptyList() || object == Collections.emptySet()) {
      return false;
    }
    else if (object instanceof Collection) {
      Class<?> aClass = object.getClass();
      String simpleName = aClass.getSimpleName();
      if (simpleName.equals("EmptyList") || simpleName.startsWith("Unmodifiable") || simpleName.equals("EmptySet")) {
        return false;
      }

      String fullName = aClass.getName();
      if (fullName.equals("java.util.Arrays$ArrayList") ||
          fullName.equals("java.util.Collections$SingletonList") ||
          fullName.equals("java.util.Collections$SingletonSet")) {
        return false;
      }

      Class<?> declaringClass = aClass.getDeclaringClass();
      return declaringClass == null || !"ImmutableCollections".equals(declaringClass.getSimpleName());
    }
    else {
      return false;
    }
  }
public static boolean isMutableCollection(@NotNull Object object)