Why are we doing this instead of just having the java Monoid class create a Class => Monoid mapping? This seems pretty brittle for saving not that many lines of writing.