Added new fields to toString.
Formatting.
Moved a test case; also rewrote the setup using lambdas.
Added comments.
Layout.
Use Map.computeIfAbsent to omit set initialisation.
Clarified log statement.