private static boolean isReadResolveMethod(@NotNull UMethod method, @Nullable RefClass refClass) {
    if (!"readResolve".equals(method.getName())) return false;
    if (method.isStatic()) return false;
    if (!method.getUastParameters().isEmpty()) return false;
    if (!equalsToText(method.getReturnType(), CommonClassNames.JAVA_LANG_OBJECT)) return false;
    UClass aClass = UDeclarationKt.getContainingDeclaration(method, UClass.class);
    return aClass == null || isSerializable(aClass, refClass);
  }
private static boolean isReadResolveMethod(@NotNull UMethod method, @Nullable RefClass refClass)