title: How to convert Mono object to other Mono object in Spring Webflux
body: <p>I have a class like this</p>
  <pre class="lang-java prettyprint-override"><code>public class Person {
        private String name;
        private String age;
        private Boolean student;
        ...
        //
        getters and setters
  }
  </code></pre>
  <pre class="lang-java prettyprint-override"><code>public class PersonDto {
        private List&lt;Person&gt; persons
        private Person president
        //
        getters and setters
  }
  </code></pre>
  <p>and get data to webclient from external API</p>
  <pre class="lang-java prettyprint-override"><code>--- omitted ---
  final Mono&lt;PersonDto&gt; personDto = wrapperWebClient.getPersonDto(uriComponents, params, PersonDto.class);
  Mono&lt;StudentDto&gt; studentDto = convert(personDto);
  --- omitted ---
  </code></pre>
  <p>and I want to transform data Mono DTO like below.</p>
  <pre class="lang-java prettyprint-override"><code>public class Student {
        // no constructors 
        private String name;
        private String age;
        private Boolean student;
        ...
        //
        getters and setters
  }
  </code></pre>
  <pre class="lang-java prettyprint-override"><code>public class StudentDto {
        private List&lt;Student&gt; students;
        private Student represent;
        ...
        //
        getters and setters
  }
  </code></pre>
  <p>it's my try</p>
  <pre class="lang-java prettyprint-override"><code>--- omitted ---
  private Mono&lt;StudentDto&gt; convert(Mono&lt;PersonDto&gt; personDto) {
        StudentDto studentDto = new StudentDto();
        personDto.map(
            persons -&gt; {
                studentDto.setStudents(
                        persons.getPersons()
                         .stream().filter(person -&gt; person.isStudent())
                         .collect(toList())
                );
                studentDto.setRepresent(
                        persons.getRepresent().isStudent()
                );
            }
        )
        return ???;
  } 
  
  </code></pre>
  <p>My approach seems to be synchronous.</p>