A stateless utility class with overloaded static methods that format a person's name | Workbook p.79-80
Build a class called NameFormatter whose only job is to take name pieces and return a formatted name string. The class should never be instantiated — you call it like a library, the same way you call Math.sqrt(...). Make the constructor private so nobody can accidentally do new NameFormatter().
Provide three overloaded versions of format — one for the simplest case (just first and last name), one for the full case with prefix / middle / suffix, and one that takes a single full-name string and reformats it.
"LastName, FirstName".
prefix, middleName, or suffix may be an empty string — handle that gracefully so you don't get extra spaces or stray commas in the output.
"Prefix FirstName MiddleName LastName, Suffix". Your method splits it into its pieces and returns the same standard "LastName, Prefix FirstName MiddleName, Suffix" shape.
The standard shape is LastName, Prefix FirstName MiddleName, Suffix — with pieces dropped cleanly when they're missing.
"Johnson, , Mel ," is wrong — it leaks the missing pieces into the output.
NameFormatter doesn't need to remember anything between calls. It has no fields, no state, no identity — just pure input-to-output behavior. That's the textbook signature of a stateless utility.
Stateless utilities should be static classes: every method is static, the constructor is private, and you call methods directly off the class name. This is exactly how Math, Collections, and Arrays are built in the standard library.
Math.sqrt() — you don't do new Math(), you call the method directly. Same pattern here: NameFormatter.format(...).
Workbook 4a Module 4, Exercise 1, p.79-80 — NameFormatter