Convert List to String

List of String:

String.join(",", yourListString);

List of Objetcs:

String content = yourListObjs.stream()
        .map(obj -> obj.toString())
        .collect(Collectors.joining(System.lineSeparator()));

Sort List of Objects by Property

yourList.sort(Comparator.comparing(obj -> obj.getYourProperty));

Sort List of String:
list.sort(String::compareToIgnoreCase);

Check to be sure that port 22 is enabled before you reload

 https://superuser.com/questions/590600/ufw-is-active-but-not-enabled-why etting  ENABLED=yes  in  /etc/ufw/ufw.conf  did it for me. $ sudo ...