The correct Java incantations to make casting unnecessary