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);

Redirect www.example.com to example.com

 https://stackoverflow.com/questions/39303725/virtual-host-force-https-and-redirect-www-to-non-www-but-no-other-subdomains With the proper u...