package org.ybiquitous.messages;

final class Utils {

    public static <T> T notNull(T obj, String name) throws NullPointerException {
        if (obj == null) {
            throw new NullPointerException(name + " is required");
        }
        return obj;
    }

    private Utils() {
    }
}

package org.ybiquitous.messages;

final class Utils {

    public static <T> T notNull(T obj, String name) throws NullPointerException {
        if (obj == null) {
            if (name == null) {
                throw new NullPointerException();
            } else {
                throw new NullPointerException(name + " is required");
            }
        }
        return obj;
    }

    private Utils() {
    }
}

fix Utils#notNull: if name parameter is null, call NullPointerException() not NullPointerException(String)