title: Transform mono on operations success
body: <p>I'm dealing with the <a href="https://github.com/cloudfoundry/cf-java-client" rel="nofollow noreferrer">Cloudfoundry Java client</a> for the following use case: </p>
  
  <ul>
  <li>I perform a request that returns a <code>Mono&lt;Void&gt;</code></li>
  <li>On success of this <code>Mono</code>, I want to perform an optional operation that returns a <code>Mono&lt;String&gt;</code></li>
  <li>For deciding when to perform the second operation, I'm using  <code>filter</code>,  but it doesn't seem to work</li>
  </ul>
  
  <p>So, it looks like this:</p>
  
  <pre><code>Mono&lt;Void&gt; service = createService();
  Mono&lt;String&gt; serviceKey =  service.filter( x -&gt; someBoolean)
     .map( x -&gt; someKey)
     .flatMap(key -&gt;  {
         Mono&lt;String&gt; key = serviceKey(key);
         return key;
       });
  
  serviceKey.blockOptional() //returns Empty
  </code></pre>
  
  <p>My expectation would be that, when <code>service</code> succeeds and the <code>filter</code> operation is succesfull,  the second call <code>serviceKey</code> would happen. However, I saw with the debugger that the code inside <code>flatMap</code> nevers get executed. 
  The <code>javadoc</code> for <code>Mono#filter</code> states: </p>
  
  <blockquote>
    <p>If this Mono is valued, test the result and replay it if predicate returns true. Otherwise complete without value.</p>
  </blockquote>
  
  <p>Not sure how to understand that... Question is, how can I chain successful operations when the first one returns a <code>Mono&lt;Void&gt;</code>?
  I just want to perform the second one when the first is succesful, and return an empty <code>Mono</code> when the filter predicates fails.</p>