title: Can a Groovy closure extend an abstract class
body: <p>I have an abstract Java class that needs to have one method <code>onMessage</code> to be implemented. I know that a closure can easily implement a Java interface using the <code>as</code> keyword, but how can it extend an abstract Java class?</p>
  
  <p>If it can't extend it, then whats the best work around possible in such cases in Groovy?</p>
  
  <p>Here is my usage in Java, I am looking for something similar that can be done in Groovy.</p>
  
  <pre><code>MessageCallback callback = new MessageCallback() {
              @Override
              public void onMessage(Message message) {
                  dosomething();
              }
          };
  </code></pre>
  
  <p>Where message callback is my abstract class which I would like to use in a similar fashion in Groovy.</p>