@SuppressWarnings("unchecked")
    public static <T> TypeInformation<T> createTypeInfo(Class<T> type) {
        return (TypeInformation<T>) createTypeInfo((Type) type);
    }
@Test
    void testCreateTypeInfoFromInstance() {
        ResultTypeQueryable instance =
                new ResultTypeQueryable<Long>() {
                    @Override
                    public TypeInformation<Long> getProducedType() {
                        return BasicTypeInfo.LONG_TYPE_INFO;
                    }
                };
        TypeInformation<?> ti = TypeExtractor.createTypeInfo(instance, null, null, 0);
        assertThat(ti).isEqualTo(BasicTypeInfo.LONG_TYPE_INFO);

        // method also needs to work for instances that do not implement ResultTypeQueryable
        MapFunction<Integer, Long> func =
                new MapFunction<Integer, Long>() {
                    @Override
                    public Long map(Integer value) throws Exception {
                        return value.longValue();
                    }
                };
        ti = TypeExtractor.createTypeInfo(func, MapFunction.class, func.getClass(), 0);
        assertThat(ti).isEqualTo(BasicTypeInfo.INT_TYPE_INFO);
    }