@Test
public void testGetParameterTypes() {

    Class<?> demoServiceClass = DemoService.class;
    String serviceName = demoServiceClass.getName();
    Invoker invoker = mock(Invoker.class);
    // 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(String.class, parameterTypes5[1]);
    Assertions.assertEquals(String.class, parameterTypes5[2]);
}