Code samplel for java cast clarify