default <T> @NonNull Optional<T> getSubject(@NonNull Class<T> subjectClass) {
        Object subject = getSubject();
        return subjectClass.isInstance(subject) ? Optional.of(subjectClass.cast(subject)) : Optional.empty();
    }
Gets the subject whose contexts were updated, casted to a given type.

@param subjectClass the type to cast to
@param <T> the subject type
@return the casted subject
api/src/main/java/net/luckperms/api/event/context/ContextUpdateEvent.java