I want to test if a class not only implements MyInt, but if that class implements MyInt<String>
You might wanted to do something like
Class<MyInt<String> > c = MyInt<String>.class;
but this is not possible due to type erasure. See Java: how do I get a class literal from a generic type? for a very good explanation.
To still be able to check whether your class implements an interface which uses some specific type, you can retrieve the generic type arguments of a given class and check the type of it:
Class c0 = MyString.class;
Class c1 = MyDouble.class;
ParameterizedType c0Type = (ParameterizedType) c0.getGenericInterfaces()[0];
Class<?> type0Class = (Class<?>) c0Type.getActualTypeArguments()[0];
ParameterizedType c1Type = (ParameterizedType) c1.getGenericInterfaces()[0];
Class<?> type1Class = (Class<?>) c1Type.getActualTypeArguments()[0];
System.out.println(type0Class.isAssignableFrom(String.class)); // true
System.out.println(type1Class.isAssignableFrom(String.class)); // false
This should work for your particular case. You need to adjust the array indexes when you are implementing more than one interface and/or using more than one generic type parameter.