@Test
public void testGenerate() {

    AtomHashGenerator atomGenerator = mock(AtomHashGenerator.class);
    Pseudorandom prng = mock(Pseudorandom.class);
    IAtomContainer container = mock(IAtomContainer.class);
    MoleculeHashGenerator generator = new BasicMoleculeHashGenerator(atomGenerator, prng);
    when(atomGenerator.generate(container)).thenReturn(new long[]{1, 1, 1, 1});
    when(prng.next(1L)).thenReturn(1L);
    long hashCode = generator.generate(container);
    verify(atomGenerator, times(1)).generate(container);
    verify(prng, times(3)).next(1L);
    verifyNoMoreInteractions(atomGenerator, container, prng);
    long expected = 2147483647L ^ 1L ^ 1L ^ 1L ^ 1L;
    assertThat(hashCode, is(expected));
}