@Nonnull
    static <T extends GsonSerializable> T deserialize(@Nonnull Class<T> clazz, @Nonnull JsonElement element) {
        Method deserializeMethod = getDeserializeMethod(clazz);
        if (deserializeMethod == null) {
            throw new IllegalStateException("Class does not have a deserialize method accessible.");
        }

        try {
            //noinspection unchecked
            return (T) deserializeMethod.invoke(null, element);
        } catch (IllegalAccessException | InvocationTargetException e) {
            throw new RuntimeException(e);
        }
    }
Deserializes a JsonElement to a GsonSerializable object.

@param clazz the GsonSerializable class
@param element the json element to deserialize
@param <T> the GsonSerializable type
@return the deserialized object
@throws IllegalStateException if the clazz does not have a deserialization method
helper/src/main/java/me/lucko/helper/gson/GsonSerializable.java