Add chapter 5 singleton chocolate factory code, illustrating four different ways of implementing singleton in java, three of which are (mostly) threadsafe.