equals functionality with test