@Test public void testGetReturnTypes() throws Exception {
  Invoker invoker=mock(Invoker.class);
  given(invoker.getUrl()).willReturn(URL.valueOf("test://127.0.0.1:1/org.apache.dubbo.rpc.support.DemoService?interface=org.apache.dubbo.rpc.support.DemoService"));
  Invocation inv=new RpcInvocation("testReturnType",new Class<?>[]{String.class},null,null,invoker);
  java.lang.reflect.Type[] types=RpcUtils.getReturnTypes(inv);
  Assert.assertEquals(2,types.length);
  Assert.assertEquals(String.class,types[0]);
  Assert.assertEquals(String.class,types[1]);
  Invocation inv1=new RpcInvocation("testReturnType1",new Class<?>[]{String.class},null,null,invoker);
  java.lang.reflect.Type[] types1=RpcUtils.getReturnTypes(inv1);
  Assert.assertEquals(2,types1.length);
  Assert.assertEquals(List.class,types1[0]);
  Assert.assertEquals(DemoService.class.getMethod("testReturnType1",new Class<?>[]{String.class}).getGenericReturnType(),types1[1]);
  Invocation inv2=new RpcInvocation("testReturnType2",new Class<?>[]{String.class},null,null,invoker);
  java.lang.reflect.Type[] types2=RpcUtils.getReturnTypes(inv2);
  Assert.assertEquals(2,types2.length);
  Assert.assertEquals(String.class,types2[0]);
  Assert.assertEquals(String.class,types2[1]);
  Invocation inv3=new RpcInvocation("testReturnType3",new Class<?>[]{String.class},null,null,invoker);
  java.lang.reflect.Type[] types3=RpcUtils.getReturnTypes(inv3);
  Assert.assertEquals(2,types3.length);
  Assert.assertEquals(List.class,types3[0]);
  java.lang.reflect.Type genericReturnType3=DemoService.class.getMethod("testReturnType3",new Class<?>[]{String.class}).getGenericReturnType();
  Assert.assertEquals(((ParameterizedType)genericReturnType3).getActualTypeArguments()[0],types3[1]);
  Invocation inv4=new RpcInvocation("testReturnType4",new Class<?>[]{String.class},null,null,invoker);
  java.lang.reflect.Type[] types4=RpcUtils.getReturnTypes(inv4);
  Assert.assertEquals(2,types4.length);
  Assert.assertEquals(null,types4[0]);
  Assert.assertEquals(null,types4[1]);
  Invocation inv5=new RpcInvocation("testReturnType5",new Class<?>[]{String.class},null,null,invoker);
  java.lang.reflect.Type[] types5=RpcUtils.getReturnTypes(inv5);
  Assert.assertEquals(2,types5.length);
  Assert.assertEquals(Map.class,types5[0]);
  java.lang.reflect.Type genericReturnType5=DemoService.class.getMethod("testReturnType5",new Class<?>[]{String.class}).getGenericReturnType();
  Assert.assertEquals(((ParameterizedType)genericReturnType5).getActualTypeArguments()[0],types5[1]);
}
