title: No instance(s) of type variable(s) T exist so that Flux<T> confirms to Mono<? extend R)
body: <p>I am implementing Spring webflux demo application and have written my demo application as like that</p>
  
  <pre><code>package com.abcplusd.application;
  
  import com.abcplusd.domain.Event;
  import org.springframework.boot.CommandLineRunner;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.boot.builder.SpringApplicationBuilder;
  import org.springframework.context.annotation.Bean;
  import org.springframework.http.MediaType;
  import org.springframework.web.reactive.function.client.WebClient;
  import reactor.core.publisher.Flux;
  
  import java.util.Collections;
  import java.util.Date;
  import java.util.stream.Stream;
  
  @SpringBootApplication
  public class ReactiveClientApplication {
  
      @Bean WebClient webClient() {
          return WebClient.create("http://localhost:8080");
      }
  
      @Bean CommandLineRunner demo(WebClient webClient) {
          return args -&gt; {
              webClient.get()
                  .uri("/events")
                  .accept(MediaType.TEXT_EVENT_STREAM)
                  .exchange()
                  .flatMap(clientResponse -&gt; clientResponse.bodyToFlux(Event.class))
                  .subscribe(System.out::println);
          };
      }
      public static void main(String[] args) {
          new SpringApplicationBuilder(ReactiveClientApplication.class)
              .properties(Collections.singletonMap("server.port", "8081"))
              .run(args);
      }
  }
  </code></pre>
  
  <p>It shows the following error</p>
  
  <pre><code>Error:(29, 41) java: incompatible types: no instance(s) of type variable(s) T exist so that reactor.core.publisher.Flux&lt;T&gt; conforms to reactor.core.publisher.Mono&lt;? extends R&gt;
  </code></pre>
  
  <p>The above error is at this line:</p>
  
  <pre><code>                    .flatMap(clientResponse -&gt; clientResponse.bodyToFlux(Event.class)))
  </code></pre>
  
  <h3>Event Class</h3>
  
  <pre><code>import lombok.AllArgsConstructor;
  import lombok.Data;
  
  import java.util.Date;
  
  @Data
  @AllArgsConstructor
  public class Event {
      private  long id;
      private Date when;
  }
  </code></pre>
  
  <p>Can anybody help me to solve the error?</p>