@Test
public void mapKeyAndValueTypes() throws Exception {

    Type mapOfStringIntegerType = TypesTest.class.getDeclaredField(
            "mapOfStringInteger").getGenericType();
    assertThat(Types.mapKeyAndValueTypes(mapOfStringIntegerType, Map.class),
            is(Matchers.<Type>arrayContaining(String.class, Integer.class)));
}