added unit test, extracted shared code to setup
added unit tests for equals method