public static <T> Class<T> toClass(String className) {
        switch (className) {
            case "boolean":
                return cast(boolean.class);
            case "byte":
                return cast(byte.class);
            case "short":
                return cast(short.class);
            case "int":
                return cast(int.class);
            case "long":
                return cast(long.class);
            case "float":
                return cast(float.class);
            case "double":
                return cast(double.class);
            case "char":
                return cast(char.class);
            case "void":
                return cast(void.class);
            default:
                try {
                    return cast(loadClass(className));
                } catch (ClassNotFoundException ex) {
                    throw new IllegalArgumentException("Class not found: " + className, ex);
                }
        }
    }
@Test
    void testToClass() {
        assertThat(ReflectionUtils.toClass("boolean")).isEqualTo(boolean.class);
        assertThat(ReflectionUtils.toClass("byte")).isEqualTo(byte.class);
        assertThat(ReflectionUtils.toClass("short")).isEqualTo(short.class);
        assertThat(ReflectionUtils.toClass("int")).isEqualTo(int.class);
        assertThat(ReflectionUtils.toClass("long")).isEqualTo(long.class);
        assertThat(ReflectionUtils.toClass("float")).isEqualTo(float.class);
        assertThat(ReflectionUtils.toClass("double")).isEqualTo(double.class);
        assertThat(ReflectionUtils.toClass("char")).isEqualTo(char.class);
        assertThat(ReflectionUtils.toClass("void")).isEqualTo(void.class);

        assertThat(ReflectionUtils.toClass("java.lang.String")).isEqualTo(String.class);
        assertThatThrownBy(() -> ReflectionUtils.toClass("class.that.does.not.exist")).isInstanceOf(IllegalArgumentException.class);
    }