/**
  * Transforms a complete list of {@link PtuFlexOffer} to a {@link FlexOfferDto}.
  *
  * @param ptuFlexOffers a {@link java.util.List} of {@link PtuFlexOffer}.
  * @return a {@link FlexOfferDto}.
  */
 public static FlexOfferDto transformPtuFlexOffers(List<PtuFlexOffer> ptuFlexOffers) {
   if (ptuFlexOffers == null || ptuFlexOffers.isEmpty()) {
     return null;
   }
   PtuFlexOffer firstPtuFlexOffer = ptuFlexOffers.get(0);
   FlexOfferDto flexOfferDto = new FlexOfferDto();
   flexOfferDto.setParticipantDomain(firstPtuFlexOffer.getParticipantDomain());
   flexOfferDto.setConnectionGroupEntityAddress(
       firstPtuFlexOffer.getConnectionGroup().getUsefIdentifier());
   flexOfferDto.setPeriod(firstPtuFlexOffer.getPtuContainer().getPtuDate());
   flexOfferDto.setFlexRequestSequenceNumber(firstPtuFlexOffer.getFlexRequestSequence());
   flexOfferDto.setSequenceNumber(firstPtuFlexOffer.getSequence());
   ptuFlexOffers
       .stream()
       .forEach(ptuFlexOffer -> flexOfferDto.getPtus().add(transformPtuFlexOffer(ptuFlexOffer)));
   return flexOfferDto;
 }