### Question:
RetryHandlerUtils { public static void validateRetryHandler(Class<?> clazz) { Type interfaceType = getRetryHandlerGenericInterface(clazz); Class<?> argsInputType = Object.class; if (interfaceType instanceof ParameterizedType) { Type type = ((ParameterizedType) interfaceType).getActualTypeArguments()[0]; if (type instanceof Class) { argsInputType = (Class<?>) ((ParameterizedType) interfaceType).getActualTypeArguments()[0]; } else { throw new IllegalRetryException("重试方法的参数类型不能是集合类等带泛型的"); } } if (Object.class.equals(argsInputType)) { throw new IllegalRetryException("重试方法的参数类型[" + argsInputType + "]不能是Object或其他不能序列化和反序列化的类型"); } else if (Collection.class.isAssignableFrom(argsInputType) || Map.class.isAssignableFrom(argsInputType)) { throw new IllegalRetryException("重试方法的参数类型[" + argsInputType + "]不能是集合类等带泛型的"); } } private  RetryHandlerUtils(); static boolean isRetryFunctionMethod(Method method); static void validateRetryHandler(Class<?> clazz); static void validateRetryFunction(Method method); static boolean isRetryHandlerMethod(Class<?> targetClass, Method method); static Type getRetryHandlerGenericInterface(Class<?> clazz); static String getMethodIdentity(Method method);  }### Answer:
@Test(expected = IllegalRetryException.class) public void testValidateRetryHandlerWithMap() { RetryHandlerUtils.validateRetryHandler(MapRetryHandler.class); }
@Test public void testValidateRetryHandlerWithUser() { RetryHandlerUtils.validateRetryHandler(UserRetryHandler.class); RetryHandlerUtils.validateRetryHandler(GenericUserRetryHandler.class); }
@Test(expected = IllegalRetryException.class) public void testValidateRetryHandlerWithObject() { RetryHandlerUtils.validateRetryHandler(ObjectRetryHandler.class); }
@Test(expected = IllegalRetryException.class) public void testValidateRetryHandlerWithList() { RetryHandlerUtils.validateRetryHandler(ListRetryHandler.class); }
@Test(expected = IllegalRetryException.class) public void testValidateRetryHandlerWithListUser() { RetryHandlerUtils.validateRetryHandler(ListUserRetryHandler.class); }