package com.steps.tmuapp.lib;

public class ToolsHelper {
    /**
     * Checks that the specified object reference is not null.
     *
     * This is a copy of Objects.requireNonNull() in API 19.  This avoids having to raise the
     * min API from 18 to 19.  Replace it with Objects.requireNonNull() if you raise min API
     * higher or equal to 19.
     *
     * @param obj the object reference to check for nullity
     * @param <T> the type of the reference
     * @return obj if not null
     */
    public static <T> T requireNonNull(T obj) {
        if (obj == null) {
            throw new NullPointerException();
        }
        return obj;
    }
}
