for (Type type : genericInterfaces)
{
if (type instanceof ParameterizedType)
{
ParameterizedType t = (ParameterizedType) type;
Type rawType = t.getRawType();
if (rawType instanceof Class && rawType.equals(genericInterface))
{
Type[] actualTypeArguments = t.getActualTypeArguments();
if (actualTypeArguments.length > 0)
{
Type arg = actualTypeArguments[0];
if (arg instanceof Class)
{
Class<Object> expectedType = (Class<Object>) arg;