title: How to avoid callback hell in Java?
body: <p>I have java app with sequence of api calls (I'm using retrofit). Currently it looks like pyramid:</p>
  
  <pre><code>mApi.login(request, new Callback&lt;LoginResponse&gt;() {
    @Override
    public void success(LoginResponse s, Response response) {
       mApi.getRoutes(request, new Callback&lt;RoutesResponse&gt;() {
          @Override
          public void success(RoutesResponses, Response response) {
             ...
          }
          @Override
          public void failure(RetrofitError error) {}
       }
    }
  
     @Override
     public void failure(RetrofitError error) {}
  });
  </code></pre>
  
  <p>Are there some libraries to avoid callback hell? like TwoStep or Q in javascript.</p>