class TypeUtils {

    @Nullable
    public static Number castToNumber(@Nonnull Object value) {
        requireNonNull(value, ERROR_VALUE_NULL);
        if (value instanceof Number) {
            return (Number) value;
        }
        throw new IllegalArgumentException("Don't know how to cast '" + value + "' to " + Number.class.getName());
    }

    private  TypeUtils();

}