Added missing hashcode / equals / toString methods and corresponding test.