Making toString function more readable In Java
This answer to a question on multi line strings contains a lot of good examples of trouble with building multi line string output this way but in particular I think the String.format approach works best with a template string.

Your setup would be something like

String template = “ Name: %s %n ID: ...”


And you would place it with

String formatted = String.format(template, nameString, idString,...);




Don’t like their sorting algorithm? I’d recommend extending your own! You can provide your own comparator for the sort stream function. This gives you complete control over how it sorts, at the expense of providing the desired sorting logic.
This article contains several examples of ways to extend your own comparators to this function