Gray  Code in java