refactored tests to use hamcrest matchers.