@PublicEvolving
    public static <IN, OUT> TypeInformation<OUT> getKeySelectorTypes(
            KeySelector<IN, OUT> selectorInterface, TypeInformation<IN> inType) {
        return getKeySelectorTypes(selectorInterface, inType, null, false);
    }
@SuppressWarnings({"serial", "unchecked", "rawtypes"})
    @Test
    void testExtractKeySelector() {
        KeySelector<String, Integer> selector =
                new KeySelector<String, Integer>() {
                    @Override
                    public Integer getKey(String value) {
                        return null;
                    }
                };

        TypeInformation<?> ti =
                TypeExtractor.getKeySelectorTypes(selector, BasicTypeInfo.STRING_TYPE_INFO);
        assertThat(ti).isEqualTo(BasicTypeInfo.INT_TYPE_INFO);

        assertThatThrownBy(
                        () ->
                                TypeExtractor.getKeySelectorTypes(
                                        (KeySelector) selector, BasicTypeInfo.BOOLEAN_TYPE_INFO))
                .isInstanceOf(InvalidTypesException.class);
    }