@Test
public void testRotation() throws Exception {

    AtomHashGenerator seedMock = mock(AtomHashGenerator.class);
    IAtomContainer container = mock(IAtomContainer.class);
    SuppressedAtomHashGenerator generator = new SuppressedAtomHashGenerator(mock(AtomHashGenerator.class),
            new Xorshift(), AtomSuppression.unsuppressed(), 2);
    int[][] graph = new int[][]{{1, 2, 3}, {0}, {0}, {0}};
    // simulate 3 identical neighbors
    long[] invs = new long[]{21, 31, 31, 31};
    long[] unique = new long[4];
    long[] rotated = new long[4];
    // non-suppressed
    {
        long value = generator.next(graph, 0, invs, unique, rotated, Suppressed.none());
        assertThat(unique, is(new long[]{31, 0, 0, 0}));
        assertThat(rotated, is(new long[]{generator.rotate(31, 2), 0, 0, 0}));
        assertThat(value, is(generator.distribute(21) ^ 31 ^ generator.rotate(31) ^ generator.rotate(31, 2)));
    }
    // okay now suppress vertices 1
    {
        BitSet suppressed = new BitSet();
        suppressed.set(1);
        long value = generator.next(graph, 0, invs, unique, rotated, Suppressed.fromBitSet(suppressed));
        assertThat(unique, is(new long[]{31, 0, 0, 0}));
        assertThat(rotated, is(new long[]{generator.rotate(31, 1), 0, 0, 0})); // 31 only encountered twice
        assertThat(value, is(generator.distribute(21) ^ 31 ^ generator.rotate(31)));
    }
    // okay now suppress vertices 1 and 3
    {
        BitSet suppressed = new BitSet();
        suppressed.set(1);
        suppressed.set(3);
        long value = generator.next(graph, 0, invs, unique, rotated, Suppressed.fromBitSet(suppressed));
        assertThat(unique, is(new long[]{31, 0, 0, 0}));
        assertThat(rotated, is(new long[]{31, 0, 0, 0})); // 31 only encountered once and is not rotated
        assertThat(value, is(generator.distribute(21) ^ 31)); // only encountered once
    }
}