refactored asserts to use hamcrest matchers.