title: remove duplicate code in java
body: <pre><code>class A extends ApiClass
  {
     public void duplicateMethod()
     {
     }
  }    
  
  
  class B extends AnotherApiClass
  {
     public void duplicateMethod()
     {
     }
  }
  </code></pre>
  
  <p>I have two classes which extend different api classes. The two class has some duplicate
  methods(same method repeated in both class) and how to remove this duplication?</p>
  
  <h1>Edit</h1>
  
  <p>Both ApiClass and AnotherApiClass are not under my control</p>