package com.stablekernel.standardlib;

import com.squareup.okhttp.Interceptor;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;

import java.io.IOException;

public class AuthRetryInterceptor implements Interceptor {

    private static final String TAG = "AuthRetryInterceptor";
    private final Object lockObject = new Object();

    @Override
    public Response intercept(Chain chain) throws IOException {
        String token = getAccessToken();
        Request.Builder builder = chain.request().newBuilder();
        Response response = chain.proceed(builder.build());
        if (response.code() == 401) {
            synchronized (lockObject) {
                String currentToken = getAccessToken();
                if (currentToken != null && currentToken.equals(token)) {
                    return performRefresh(chain, builder);
                }
            }
        }
        return response;
    }

    private Response performRefresh(Chain chain, Request.Builder builder) throws IOException {
        try {
            IOException exception = refreshAccessToken();
            Response response = chain.proceed(builder.build());
            if (response.code() < 200 || response.code() >= 300) {
                throw exception;
            }
            return response;
        } catch (IOException e) {
            performRefreshFailure(e);
            throw e;
        }
    }

    public String getAccessToken(){ return  null; }

    public IOException refreshAccessToken() { return null; }

    public void performRefreshFailure(IOException e) {}
}

@@ -182,16 +182,25 @@
 %0Apublic 
+abstract 
 class Au
@@ -1438,16 +1438,25 @@
  public 
+abstract 
 String g
@@ -1474,25 +1474,9 @@
 en()
-%7B return  null; %7D
+;
 %0A%0A  
@@ -1484,16 +1484,25 @@
  public 
+abstract 
 IOExcept
@@ -1529,25 +1529,9 @@
 en()
- %7B return null; %7D
+;
 %0A%0A  
@@ -1539,16 +1539,25 @@
  public 
+abstract 
 void per
@@ -1593,10 +1593,8 @@
 n e)
- %7B%7D
+;
 %0A%7D%0A

Make interceptor abstract