title: No instance(s) of type variable(s) U exist so that Optional<U> conforms to Response
body: <p>I have the following:</p>
  
  <pre><code>Optional&lt;Resource&gt; updatedResource = update(resourceID, data);
  
  if (updatedResource.isPresent()) {
      return Response.status(Response.Status.OK).entity(updatedResource.get()).build();
  }
  </code></pre>
  
  <p>I would like to avoid the <code>isPresent</code> and <code>get</code> calls if possible, so I tried</p>
  
  <pre><code>return update(resourceID, data).map(updatedResource -&gt; Response.status(Response.Status.OK).entity(updatedResource).build();
  </code></pre>
  
  <p>but IntelliJ shows me the following error:</p>
  
  <p><code>No instance(s) of type variable(s) U exist so that Optional&lt;U&gt; conforms to Response</code></p>
  
  <p>Why do I get this error, and is there a way to avoid it and also avoid <code>isPresent</code> and <code>get</code>?</p>