I assume you're wondering why you're getting an error?
The dereference (dot) operator has higher precedence than the cast operator does. This means the compiler thinks you're trying to call getTestValue() before you're casting o to TestOne.
Aside from that, you shouldn't have statements of the form
Note your class does not conform to Object's contract. You're not overriding the hashCode() method in accordance with the equals() method.
The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.