code: public static void addProviderProfileInfo(Profile profile, UserProfile providerProfile) {
          String email = providerProfile.getEmail();
          if (StringUtils.isEmpty(email)) {
              throw new IllegalStateException("No email included in provider profile");
          }
  
          String username = providerProfile.getUsername();
          if (StringUtils.isEmpty(username)) {
              username = email;
          }
  
          String firstName = providerProfile.getFirstName();
          String lastName = providerProfile.getLastName();
  
          profile.setUsername(username);
          profile.setEmail(email);
          profile.setAttribute(FIRST_NAME_ATTRIBUTE_NAME, firstName);
          profile.setAttribute(LAST_NAME_ATTRIBUTE_NAME, lastName);
      }
docs: Adds the info from the provider profile to the specified profile.
  
  @param profile           the target profile
  @param providerProfile   the provider profile where to get the info