compare value and object java