title: Serializing anonymous classes with Gson
body: <p>Is there any reason to why you cant serialize anonymous classes to Json?</p>
  
  <p>Example:</p>
  
  <pre><code>public class AnonymousTest
  {
      private Gson gson = new Gson();
  
      public void goWild()
      {
          this.callBack(new Result()
          {
              public void loginResult(Result loginAttempt)
              {
                  // Output null
                  System.out.println(this.gson.toJson(result));   
              }
          });
      }
  
      public void callBack(Result result)
      {
          // Output null
          System.out.println(this.gson.toJson(result));
          result.loginResult(result);
      }
  
      public static void main(String[] args) 
      {
          new AnonymousTest().goWild();
      }
  }
  </code></pre>
  
  <p>Just getting started with it :)</p>