code: public static List<String> removeAddressPort(List<String> stringList) {
          List<String> adresNoPort = new ArrayList<>();
  
          for (String s : stringList) {
              int index = s.indexOf(":");
              if (index > -1) {
                  adresNoPort.add(s.substring(0, index));
                  continue;
              }
              adresNoPort.add(s);
  
          }
          return adresNoPort;
      }
docs: Remove address port.
  
  @param stringList the string list
  @return the list