public static Class<?>[] getParameterTypes(Invocation invocation) {
        if (($INVOKE.equals(invocation.getMethodName()) || $INVOKE_ASYNC.equals(invocation.getMethodName()))
                && invocation.getArguments() != null
                && invocation.getArguments().length > 1
                && invocation.getArguments()[1] instanceof String[]) {
            String[] types = (String[]) invocation.getArguments()[1];
            if (types == null) {
                return new Class<?>[0];
            }
            Class<?>[] parameterTypes = new Class<?>[types.length];
            for (int i = 0; i < types.length; i++) {
                parameterTypes[i] = ReflectUtils.forName(types[i]);
            }
            return parameterTypes;
        }
        return invocation.getParameterTypes();
    }
@Test
    void testGetParameterTypes() {
        Class<?> demoServiceClass = DemoService.class;
        String serviceName = demoServiceClass.getName();
        Invoker invoker = createMockInvoker();

        // void sayHello(String name);
        RpcInvocation inv1 = new RpcInvocation(
                "sayHello", serviceName, "", new Class<?>[] {String.class}, null, null, invoker, null);
        Class<?>[] parameterTypes1 = RpcUtils.getParameterTypes(inv1);
        Assertions.assertNotNull(parameterTypes1);
        Assertions.assertEquals(1, parameterTypes1.length);
        Assertions.assertEquals(String.class, parameterTypes1[0]);

        // long timestamp();
        RpcInvocation inv2 = new RpcInvocation("timestamp", serviceName, "", null, null, null, invoker, null);
        Class<?>[] parameterTypes2 = RpcUtils.getParameterTypes(inv2);
        Assertions.assertEquals(0, parameterTypes2.length);

        // Type enumlength(Type... types);
        RpcInvocation inv3 = new RpcInvocation(
                "enumlength", serviceName, "", new Class<?>[] {Type.class, Type.class}, null, null, invoker, null);
        Class<?>[] parameterTypes3 = RpcUtils.getParameterTypes(inv3);
        Assertions.assertNotNull(parameterTypes3);
        Assertions.assertEquals(2, parameterTypes3.length);
        Assertions.assertEquals(Type.class, parameterTypes3[0]);
        Assertions.assertEquals(Type.class, parameterTypes3[1]);

        // byte getbyte(byte arg);
        RpcInvocation inv4 =
                new RpcInvocation("getbyte", serviceName, "", new Class<?>[] {byte.class}, null, null, invoker, null);
        Class<?>[] parameterTypes4 = RpcUtils.getParameterTypes(inv4);
        Assertions.assertNotNull(parameterTypes4);
        Assertions.assertEquals(1, parameterTypes4.length);
        Assertions.assertEquals(byte.class, parameterTypes4[0]);

        // void $invoke(String s1, String s2);
        RpcInvocation inv5 = new RpcInvocation(
                "$invoke",
                serviceName,
                "",
                new Class<?>[] {String.class, String[].class},
                new Object[] {"method", new String[] {"java.lang.String", "void", "java.lang.Object"}},
                null,
                invoker,
                null);
        Class<?>[] parameterTypes5 = RpcUtils.getParameterTypes(inv5);
        Assertions.assertNotNull(parameterTypes5);
        Assertions.assertEquals(3, parameterTypes5.length);
        Assertions.assertEquals(String.class, parameterTypes5[0]);
        Assertions.assertEquals(void.class, parameterTypes5[1]);
        Assertions.assertEquals(Object.class, parameterTypes5[2]);
    }