strong type checking in java - Search