Further testing of case classes

I added some extra test cases for case classes containing optional collections, which is a common usage pattern for us.