Add test case for PatternMatching. Update test case for class.
Optimize syntax for pattern matching.