Exemplo n.º 1
0
 @Test
 public void testTypesSatisfyVariables()
     throws SecurityException, NoSuchFieldException, NoSuchMethodException {
   final Map<TypeVariable<?>, Type> typeVarAssigns = new HashMap<TypeVariable<?>, Type>();
   final Integer max = TypeUtilsTest.<Integer>stub();
   typeVarAssigns.put(getClass().getMethod("stub").getTypeParameters()[0], Integer.class);
   Assert.assertTrue(TypeUtils.typesSatisfyVariables(typeVarAssigns));
   typeVarAssigns.clear();
   typeVarAssigns.put(getClass().getMethod("stub2").getTypeParameters()[0], Integer.class);
   Assert.assertTrue(TypeUtils.typesSatisfyVariables(typeVarAssigns));
   typeVarAssigns.clear();
   typeVarAssigns.put(getClass().getMethod("stub3").getTypeParameters()[0], Integer.class);
   Assert.assertTrue(TypeUtils.typesSatisfyVariables(typeVarAssigns));
 }