tests refactored with hamcrest matchers.