static <T> Class<T> boxClass(Class<T> type) {
        if (type == boolean.class) {
            return (Class<T>) Boolean.class;
        } else if (type == byte.class) {
            return (Class<T>) Byte.class;
        } else if (type == char.class) {
            return (Class<T>) Character.class;
        } else if (type == double.class) {
            return (Class<T>) Double.class;
        } else if (type == float.class) {
            return (Class<T>) Float.class;
        } else if (type == int.class) {
            return (Class<T>) Integer.class;
        } else if (type == long.class) {
            return (Class<T>) Long.class;
        } else if (type == short.class) {
            return (Class<T>) Short.class;
        } else {
            return type;
        }
    }