Android Volley abstract onResponse

I have two classes that will use a class that calls Volley and has the onResponse overridden. There is code that will be exactly the same in the onReponse except for two lines. What is the best way to basically call a super on the response yet still execute the extra two lines. Here is what I mean:

Class A {
   ....
   Uploader uploader = new Uploader();
   uploader.startUpload(context, path, data);

   // I know this can't be done but showing what I want
   uploader.onResponse(String response) {
      super(response);
      ... 
      call to extra code
   } 
}  

Same for a Class B but extra code is different

public class Uploader implements Response.Listener<String> {
    public Uploader() { }

    public void upLoad(final Context context, String path, String data) {
        .... build request and then make call to start request
    }

    @Override
    public void onResponse(String response) {
        ... Doing something common for both A and B Classes
    }
}

You could extract an abstract class:

abstract class MyReponseListener implements Response.Listener<String> {

    @Override
    public void onResponse(String response) {
        //the two lines of common code you want 
    }
}

and make your Uploader extend your abstract MyResponseListener:

class Uploader extends MyResponseListener {
    public Uploader() { }

    public void upLoad(final Context context, String path, String data) {

    }

    @Override
    public void onResponse(String response) {
        super(response);
    }
}

If you then wanted different behaviour for the consumers of Uploader you could then provide subclasses as dependencies as below.

Refactoring ClassA to take the dependency on Uploader:

public ClassA(Uploader uploader) {
    this.uploader = uploader;
}

Subclassing Uploader:

Uploader classAUploader = new Uploader() { 
    @Override
    public void onResponse(String response) {
        super.onResponse(response);
        //your code for the special handling in ClassA
    }
};

Passing it as a dependency for ClassA:

ClassA classA = new ClassA(classAUploader);

A better solution might use composition instead of inheritance. So Uploader has a Response.Listener<String> rather than is a Response.Listener<String>. Then the different Response.Listener<String> can be passed in as dependencies for the Uploader as above. If you used this technique you wouldn’t need to subclass Uploader merely to change the behaviour for the Response.Listener.