code: public Future<AuthenticationResult> acquireTokenByRefreshToken(
              final String refreshToken, final String clientId,
              final String resource, final AuthenticationCallback callback) {
  
          final ClientAuthentication clientAuth = new ClientAuthenticationPost(
                  ClientAuthenticationMethod.NONE, new ClientID(clientId));
          final AdalOAuthAuthorizationGrant authGrant = new AdalOAuthAuthorizationGrant(
                  new RefreshTokenGrant(new RefreshToken(refreshToken)), resource);
          return this.acquireToken(authGrant, clientAuth, callback);
      }
docs: Acquires a security token from the authority using a Refresh Token
  previously received. This method is suitable for the daemon OAuth2
  flow when a client secret is not possible.
  
  @param refreshToken
  Refresh Token to use in the refresh flow.
  @param clientId
  Name or ID of the client requesting the token.
  @param resource
  Identifier of the target resource that is the recipient of the
  requested token. If null, token is requested for the same
  resource refresh token was originally issued for. If passed,
  resource should match the original resource used to acquire
  refresh token unless token service supports refresh token for
  multiple resources.
  @param callback
  optional callback object for non-blocking execution.
  @return A {@link Future} object representing the
  {@link AuthenticationResult} of the call. It contains Access
  Token, Refresh Token and the Access Token's expiration time.
  @throws AuthenticationException
  thrown if the access token is not refreshed successfully