title: Retrieve the result of a method that is received in an anonymous innerclass callback?
body: <p>I have a little question here.</p>
  
  <pre><code>private boolean isSomethingTrue(String param) {
      boolean result = false;
      myService.hasAlerts(param,new Callback&lt;Boolean&gt;(
          @Override
          public void onSuccess(Boolean hasAlerts) {
              result = hasAlerts;
          }
      });
      return result;
  }
  </code></pre>
  
  <p>On this code, how can i return the boolean hasAlerts that is received in the callback?
  This doesn't work because the result variable is not final.
  But when it's final, it can't be modified so...</p>
  
  <p>I've done something like that:</p>
  
  <pre><code>private boolean isSomethingTrue(String param) {
      class ResultHolder {
          boolean result=false;
      }
      final ResultHolder resultHolder = new ResultHolder();
      myService.findBoolean(param,new Callback&lt;Boolean&gt;(
          @Override
          public void onSuccess(Boolean hasAlerts) {
              resultHolder.result = hasAlerts;
          }
      });
      return resultHolder.result;
  }
  </code></pre>
  
  <p>But is there a simpler solution to handle such a case?</p>
  
  <p>I've found this problem while trying to call a GWT RPC service.</p>