Class representing a gray code and related tests.