add hashCode and equals; add test case