cast in java not needed anymore