I think the Visitor example is a mistake. Couldn&#x27;t you replicate the Clojure version in Java by having a &quot;Formatter&quot; singleton that has a function for each of the different item type&#x2F;format type combinations?