@Override
    @NonNull
    public Flux<Object> decode(@NonNull Publisher<DataBuffer> input, @NonNull ResolvableType elementType,
                               @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) {

        ObjectMapper mapper = getObjectMapper();
        Flux<TokenBuffer> tokens = Jackson2Tokenizer.tokenize(
                Flux.from(input), mapper.getFactory(), mapper, true);

        ObjectReader reader = getObjectReader(elementType, hints);

        return tokens
                .as(LocaleUtils::transform)
                .handle((tokenBuffer, sink) -> {
                    try {
                        Object value = reader.readValue(tokenBuffer.asParser(getObjectMapper()));
                        logValue(value, hints);
                        if (value != null) {
                            sink.next(value);
                        }
                    } catch (IOException ex) {
                        sink.error(processException(ex));
                    }
                });
    }
@Test
    @SneakyThrows
    public void testComplexGeneric() {
        ObjectMapper mapper = new ObjectMapper();
        CustomJackson2JsonDecoder decoder = new CustomJackson2JsonDecoder(new MapperEntityFactory(), mapper);
        ResolvableType type = ResolvableType.forClassWithGenerics(PagerResult.class, ResolvableType.forClassWithGenerics(
                Map.class,String.class,MyEntity.class
        ));
        DataBuffer buffer = new DefaultDataBufferFactory().wrap("{\"pageSize\":1,\"data\":[{\"test\":{\"id\":\"test\"}}]}".getBytes());

        Object object = decoder.decode(buffer, type, MediaType.APPLICATION_JSON, Collections.emptyMap());

        assertTrue(object instanceof PagerResult);
        PagerResult<Map<String,MyEntity>> result= ((PagerResult<Map<String,MyEntity>>) object);

        assertTrue(result.getData().size()>0);
        assertEquals(result.getData().get(0).get("test").getId(), "test");
    }