private ConnectionData mapConnectionData(UserConnection userConnection) {
   return new ConnectionData(
       userConnection.getProviderId(),
       userConnection.getProviderUserId(),
       userConnection.getDisplayName(),
       userConnection.getProfileUrl(),
       userConnection.getImageUrl(),
       decrypt(userConnection.getAccessToken()),
       decrypt(userConnection.getSecret()),
       decrypt(userConnection.getRefreshToken()),
       expireTime(userConnection.getExpireTime()));
 }
  private int compareByProviderIdAndRank(UserConnection uc1, UserConnection uc2) {
    if (uc1.getProviderId().compareTo(uc2.getProviderId()) != 0)
      return uc1.getProviderId().compareTo(uc2.getProviderId());

    return Integer.compare(uc1.getRank(), uc2.getRank());
  }