test_class.file: tool/hash/src/test/java/org/openscience/cdk/hash/SeedGeneratorTest.java
test_class.identifier: SeedGeneratorTest
test_case.body: @Test
      public void testGenerate_SizeSeeding() throws Exception {
  
          IAtomContainer m1 = mock(IAtomContainer.class);
          IAtomContainer m2 = mock(IAtomContainer.class);
  
          AtomEncoder encoder = mock(AtomEncoder.class);
          SeedGenerator generator = new SeedGenerator(encoder);
  
          IAtom c1 = mock(IAtom.class);
          IAtom c2 = mock(IAtom.class);
          IAtom c3 = mock(IAtom.class);
          IAtom c4 = mock(IAtom.class);
          IAtom c5 = mock(IAtom.class);
          IAtom c6 = mock(IAtom.class);
  
          when(m1.getAtomCount()).thenReturn(5);
          when(m1.getAtom(0)).thenReturn(c1);
          when(m1.getAtom(1)).thenReturn(c2);
          when(m1.getAtom(2)).thenReturn(c3);
          when(m1.getAtom(3)).thenReturn(c4);
          when(m1.getAtom(4)).thenReturn(c5);
  
          when(m2.getAtomCount()).thenReturn(6);
          when(m2.getAtom(0)).thenReturn(c1);
          when(m2.getAtom(1)).thenReturn(c2);
          when(m2.getAtom(2)).thenReturn(c3);
          when(m2.getAtom(3)).thenReturn(c4);
          when(m2.getAtom(4)).thenReturn(c5);
          when(m2.getAtom(5)).thenReturn(c6);
  
          when(encoder.encode(c1, m1)).thenReturn(42);
          when(encoder.encode(c2, m1)).thenReturn(42);
          when(encoder.encode(c3, m1)).thenReturn(42);
          when(encoder.encode(c4, m1)).thenReturn(42);
          when(encoder.encode(c5, m1)).thenReturn(42);
  
          when(encoder.encode(c1, m2)).thenReturn(42);
          when(encoder.encode(c2, m2)).thenReturn(42);
          when(encoder.encode(c3, m2)).thenReturn(42);
          when(encoder.encode(c4, m2)).thenReturn(42);
          when(encoder.encode(c5, m2)).thenReturn(42);
          when(encoder.encode(c6, m2)).thenReturn(42);
  
          long[] v1 = generator.generate(m1);
          long[] v2 = generator.generate(m2);
  
          verify(m1, times(1)).getAtomCount();
          verify(m2, times(1)).getAtomCount();
  
          verify(m1, times(5)).getAtom(anyInt());
          verify(m2, times(6)).getAtom(anyInt());
  
          verify(encoder, times(1)).encode(c1, m1);
          verify(encoder, times(1)).encode(c2, m1);
          verify(encoder, times(1)).encode(c3, m1);
          verify(encoder, times(1)).encode(c4, m1);
          verify(encoder, times(1)).encode(c5, m1);
  
          verify(encoder, times(1)).encode(c1, m2);
          verify(encoder, times(1)).encode(c2, m2);
          verify(encoder, times(1)).encode(c3, m2);
          verify(encoder, times(1)).encode(c4, m2);
          verify(encoder, times(1)).encode(c5, m2);
          verify(encoder, times(1)).encode(c6, m2);
  
          // check the value were different (due to molecule size)
          assertThat(v1.length, is(5));
          assertThat(v2.length, is(6));
          for (int i = 0; i < v1.length; i++) {
              assertThat(v1[i], is(not(v2[i])));
          }
  
          verifyNoMoreInteractions(m1, m2, c1, c2, c3, c4, c5, c6, encoder);
  
      }
test_case.class_method_signature: SeedGeneratorTest.testGenerate_SizeSeeding()
test_case.full_signature: @Test public void testGenerate_SizeSeeding()
test_case.identifier: testGenerate_SizeSeeding
test_case.invocations: mock mock mock mock mock mock mock mock mock thenReturn when getAtomCount thenReturn when getAtom thenReturn when getAtom thenReturn when getAtom thenReturn when getAtom thenReturn when getAtom thenReturn when getAtomCount thenReturn when getAtom thenReturn when getAtom thenReturn when getAtom thenReturn when getAtom thenReturn when getAtom thenReturn when getAtom thenReturn when encode thenReturn when encode thenReturn when encode thenReturn when encode thenReturn when encode thenReturn when encode thenReturn when encode thenReturn when encode thenReturn when encode thenReturn when encode thenReturn when encode generate generate getAtomCount verify times getAtomCount verify times getAtom verify times anyInt getAtom verify times anyInt encode verify times encode verify times encode verify times encode verify times encode verify times encode verify times encode verify times encode verify times encode verify times encode verify times encode verify times assertThat is assertThat is assertThat is not verifyNoMoreInteractions
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGenerate_SizeSeeding()
focal_class.declarator: encoder
focal_class.modifier: private final
focal_class.original_string: private final AtomEncoder     encoder;
focal_class.type: AtomEncoder
focal_class.var_name: encoder
focal_class.declarator: suppression
focal_class.modifier: private final
focal_class.original_string: private final AtomSuppression suppression;
focal_class.type: AtomSuppression
focal_class.var_name: suppression
focal_class.file: tool/hash/src/main/java/org/openscience/cdk/hash/SeedGenerator.java
focal_class.identifier: SeedGenerator
focal_class.interfaces: implements AtomHashGenerator
focal_class.class_method_signature: SeedGenerator.SeedGenerator(AtomEncoder encoder)
focal_class.full_signature: public  SeedGenerator(AtomEncoder encoder)
focal_class.identifier: SeedGenerator
focal_class.modifiers: public
focal_class.parameters: (AtomEncoder encoder)
focal_class.signature:  SeedGenerator(AtomEncoder encoder)
focal_class.class_method_signature: SeedGenerator.SeedGenerator(AtomEncoder encoder, AtomSuppression suppression)
focal_class.full_signature: public  SeedGenerator(AtomEncoder encoder, AtomSuppression suppression)
focal_class.identifier: SeedGenerator
focal_class.modifiers: public
focal_class.parameters: (AtomEncoder encoder, AtomSuppression suppression)
focal_class.signature:  SeedGenerator(AtomEncoder encoder, AtomSuppression suppression)
focal_class.class_method_signature: SeedGenerator.SeedGenerator(AtomEncoder encoder, Pseudorandom pseudorandom, AtomSuppression suppression)
focal_class.full_signature:   SeedGenerator(AtomEncoder encoder, Pseudorandom pseudorandom, AtomSuppression suppression)
focal_class.identifier: SeedGenerator
focal_class.parameters: (AtomEncoder encoder, Pseudorandom pseudorandom, AtomSuppression suppression)
focal_class.signature:  SeedGenerator(AtomEncoder encoder, Pseudorandom pseudorandom, AtomSuppression suppression)
focal_class.class_method_signature: SeedGenerator.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.superclass: extends AbstractHashGenerator
focal_method.body: @Override
      public long[] generate(IAtomContainer container) {
  
          Suppressed suppressed = suppression.suppress(container);
  
          int n = container.getAtomCount();
          int m = n - suppressed.count(); // number of non-suppressed vertices
          int seed = m > 1 ? 9803 % m : 1;
  
          long[] hashes = new long[n];
  
          for (int i = 0; i < n; i++) {
              hashes[i] = distribute(seed * encoder.encode(container.getAtom(i), container));
          }
          return hashes;
      }
focal_method.class_method_signature: SeedGenerator.generate(IAtomContainer container)
focal_method.full_signature: @Override public long[] generate(IAtomContainer container)
focal_method.identifier: generate
focal_method.invocations: suppress getAtomCount count distribute encode getAtom
focal_method.modifiers: @Override public
focal_method.parameters: (IAtomContainer container)
focal_method.return: long[]
focal_method.signature: long[] generate(IAtomContainer container)