This is the code sample for java cast