test_class.file: tool/hash/src/test/java/org/openscience/cdk/hash/BasicAtomHashGeneratorTest.java
test_class.identifier: BasicAtomHashGeneratorTest
test_case.body: @Test
      public void testRotation() throws Exception {
  
          AtomHashGenerator seedMock = mock(AtomHashGenerator.class);
          IAtomContainer container = mock(IAtomContainer.class);
  
          BasicAtomHashGenerator generator = new BasicAtomHashGenerator(mock(AtomHashGenerator.class), new Xorshift(), 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];
  
          long value = generator.next(graph, 0, invs, unique, rotated);
  
          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)));
  
      }
test_case.class_method_signature: BasicAtomHashGeneratorTest.testRotation()
test_case.full_signature: @Test public void testRotation()
test_case.identifier: testRotation
test_case.invocations: mock mock mock next assertThat is assertThat is rotate assertThat is distribute rotate rotate
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRotation()
focal_class.declarator: seedGenerator
focal_class.modifier: private final
focal_class.original_string: private final AtomHashGenerator    seedGenerator;
focal_class.type: AtomHashGenerator
focal_class.var_name: seedGenerator
focal_class.declarator: factory
focal_class.modifier: private final
focal_class.original_string: private final StereoEncoderFactory factory;
focal_class.type: StereoEncoderFactory
focal_class.var_name: factory
focal_class.declarator: depth
focal_class.modifier: private final
focal_class.original_string: private final int                  depth;
focal_class.type: int
focal_class.var_name: depth
focal_class.file: tool/hash/src/main/java/org/openscience/cdk/hash/BasicAtomHashGenerator.java
focal_class.identifier: BasicAtomHashGenerator
focal_class.interfaces: implements AtomHashGenerator
focal_class.class_method_signature: BasicAtomHashGenerator.BasicAtomHashGenerator(AtomHashGenerator seedGenerator, Pseudorandom pseudorandom,
              StereoEncoderFactory factory, int depth)
focal_class.full_signature: public  BasicAtomHashGenerator(AtomHashGenerator seedGenerator, Pseudorandom pseudorandom,
              StereoEncoderFactory factory, int depth)
focal_class.identifier: BasicAtomHashGenerator
focal_class.modifiers: public
focal_class.parameters: (AtomHashGenerator seedGenerator, Pseudorandom pseudorandom,
              StereoEncoderFactory factory, int depth)
focal_class.signature:  BasicAtomHashGenerator(AtomHashGenerator seedGenerator, Pseudorandom pseudorandom,
              StereoEncoderFactory factory, int depth)
focal_class.class_method_signature: BasicAtomHashGenerator.BasicAtomHashGenerator(AtomHashGenerator seedGenerator, Pseudorandom pseudorandom, int depth)
focal_class.full_signature: public  BasicAtomHashGenerator(AtomHashGenerator seedGenerator, Pseudorandom pseudorandom, int depth)
focal_class.identifier: BasicAtomHashGenerator
focal_class.modifiers: public
focal_class.parameters: (AtomHashGenerator seedGenerator, Pseudorandom pseudorandom, int depth)
focal_class.signature:  BasicAtomHashGenerator(AtomHashGenerator seedGenerator, Pseudorandom pseudorandom, int depth)
focal_class.class_method_signature: BasicAtomHashGenerator.generate(IAtomContainer container)
focal_class.full_signature: @Override public long[] generate(IAtomContainer container)
focal_class.identifier: generate
focal_class.modifiers: @Override public
focal_class.parameters: (IAtomContainer container)
focal_class.return: long[]
focal_class.signature: long[] generate(IAtomContainer container)
focal_class.class_method_signature: BasicAtomHashGenerator.generate(long[] current, StereoEncoder encoder, int[][] graph, Suppressed suppressed)
focal_class.full_signature: @Override long[] generate(long[] current, StereoEncoder encoder, int[][] graph, Suppressed suppressed)
focal_class.identifier: generate
focal_class.modifiers: @Override
focal_class.parameters: (long[] current, StereoEncoder encoder, int[][] graph, Suppressed suppressed)
focal_class.return: long[]
focal_class.signature: long[] generate(long[] current, StereoEncoder encoder, int[][] graph, Suppressed suppressed)
focal_class.class_method_signature: BasicAtomHashGenerator.next(int[][] graph, int v, long[] current, long[] unique, long[] included)
focal_class.full_signature:  long next(int[][] graph, int v, long[] current, long[] unique, long[] included)
focal_class.identifier: next
focal_class.parameters: (int[][] graph, int v, long[] current, long[] unique, long[] included)
focal_class.return: long
focal_class.signature: long next(int[][] graph, int v, long[] current, long[] unique, long[] included)
focal_class.superclass: extends AbstractAtomHashGenerator
focal_method.body: long next(int[][] graph, int v, long[] current, long[] unique, long[] included) {
  
          long invariant = distribute(current[v]);
          int nUnique = 0;
  
          for (int w : graph[v]) {
  
              long adjInv = current[w];
  
              // find index of already included neighbor
              int i = 0;
              while (i < nUnique && unique[i] != adjInv) {
                  ++i;
              }
  
              // no match, then the value is unique, use adjInv
              // match, then rotate the previously included value
              included[i] = (i == nUnique) ? unique[nUnique++] = adjInv : rotate(included[i]);
  
              invariant ^= included[i];
          }
  
          return invariant;
      }
focal_method.class_method_signature: BasicAtomHashGenerator.next(int[][] graph, int v, long[] current, long[] unique, long[] included)
focal_method.full_signature:  long next(int[][] graph, int v, long[] current, long[] unique, long[] included)
focal_method.identifier: next
focal_method.invocations: distribute rotate
focal_method.parameters: (int[][] graph, int v, long[] current, long[] unique, long[] included)
focal_method.return: long
focal_method.signature: long next(int[][] graph, int v, long[] current, long[] unique, long[] included)