@SuppressWarnings({ "unchecked", "rawtypes" })

@Test
public void testGenericsNotInSuperclass() {
	// use getMapReturnTypes()
	RichMapFunction<?, ?> function = new RichMapFunction<LongKeyValue<String>, LongKeyValue<String>>() {
		private static final long serialVersionUID = 1L;
		@Override
		public LongKeyValue<String> map(LongKeyValue<String> value) throws Exception {
			return null;
		}
	};
	TypeInformation<?> ti = TypeExtractor.getMapReturnTypes(function, (TypeInformation) TypeInfoParser.parse("Tuple2<Long, String>"));
	Assert.assertTrue(ti.isTupleType());
	Assert.assertEquals(2, ti.getArity());
	
	TupleTypeInfo<?> tti = (TupleTypeInfo<?>) ti;
	Assert.assertEquals(LongKeyValue.class, tti.getTypeClass());
	
	Assert.assertEquals(BasicTypeInfo.LONG_TYPE_INFO, tti.getTypeAt(0));
	Assert.assertEquals(BasicTypeInfo.STRING_TYPE_INFO, tti.getTypeAt(1));
}