public static <T> T requireNonNull(T obj) {
        if (obj == null) {
            throw new NullPointerException();
        }
        return obj;
    }
Checks that the specified object reference is not {@code null}.

@param obj the object reference to check for nullity
@param <T> the type of the reference
@return {@code obj} if not {@code null}
@throws NullPointerException if {@code obj} is {@code null}
jraft-core/src/main/java/com/alipay/sofa/jraft/util/Requires.java