Added test that required head tail pattern matching