@PublicEvolving
    public static <IN, OUT> TypeInformation<OUT> getMapReturnTypes(
            MapFunction<IN, OUT> mapInterface, TypeInformation<IN> inType) {
        return getMapReturnTypes(mapInterface, inType, null, false);
    }
@Test
    void testEither() {
        MapFunction<?, ?> function =
                new MapFunction<Either<String, Boolean>, Either<String, Boolean>>() {
                    @Override
                    public Either<String, Boolean> map(Either<String, Boolean> value)
                            throws Exception {
                        return null;
                    }
                };
        TypeInformation<?> expected =
                new EitherTypeInfo(BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.BOOLEAN_TYPE_INFO);
        TypeInformation<?> ti = TypeExtractor.getMapReturnTypes((MapFunction) function, expected);
        assertThat(ti).isEqualTo(expected);
    }