Here you can find the source of getGenericReturnType(Method m)
public static Class<?> getGenericReturnType(Method m)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; public class Main { public static Class<?> getGenericReturnType(Method m) { Type t = m.getGenericReturnType(); if (t instanceof ParameterizedType) { for (Type arg : ((ParameterizedType) t).getActualTypeArguments()) { return (Class) arg; }/* www . ja va 2 s .c om*/ } return null; } }