refactored test with hamcrest matchers