code: public static List<GatewayAddress> asList(final List<String> addressList) {
          if (addressList == null || addressList.size() == 0) {
              throw new IllegalArgumentException("addresses must not be null");
          }
  
          List<GatewayAddress> list = new ArrayList<GatewayAddress>();
  
          int id = 1;
          for (String address : addressList) {
              list.add(new GatewayAddress(id++, address));
          }
  
          return list;
      }
docs: As list.
  
  @param addressList the addresses
  @return the list