final String accessToken = "1/MkSJoj1xsli0AccessToken_NKPY2";
final String clientSecret = "jakuaL9YyieakhECKL2SwZcu";
final String clientId = "ya29.1.AADtN_UtlxN3PuGAxrN2XQnZTVRvDyVWnYq4I6dws";
final String refreshToken = "1/Tl6awhpFjkMkSJoj1xsli0H2eL5YsMgU_NKPY2TyGWY";
MockTokenServerTransport transport = new MockTokenServerTransport();
transport.addClient(clientId, clientSecret);
transport.addRefreshToken(refreshToken, accessToken);
GoogleCredential credential = new GoogleCredential.Builder()
.setClientSecrets(clientId, clientSecret)
.setTransport(transport)
.setJsonFactory(JSON_FACTORY)