Refactored tests with hamcrest matchers.