@Nullable
    static Method getDeserializeMethod(@Nonnull Class<?> clazz) {
        if (!GsonSerializable.class.isAssignableFrom(clazz)) {
            return null;
        }

        Method deserializeMethod;
        try {
            //noinspection JavaReflectionMemberAccess
            deserializeMethod = clazz.getDeclaredMethod("deserialize", JsonElement.class);
            deserializeMethod.setAccessible(true);
        } catch (Exception e) {
            return null;
        }

        if (!Modifier.isStatic(deserializeMethod.getModifiers())) {
            return null;
        }

        return deserializeMethod;
    }
Gets the deserialization method for a given class.

@param clazz the class
@return the deserialization method, if the class has one
helper/src/main/java/me/lucko/helper/gson/GsonSerializable.java