Refactored test to integrate hamcrest matchers.