write a java function that implements gray code and returns the next sequence code after a given code in a given direction of rotation
spam lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor creativity violence