@Test
public void testGenerate() throws Exception {

    IAtomContainer container = 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);
    when(container.getAtomCount()).thenReturn(5);
    when(container.getAtom(0)).thenReturn(c1);
    when(container.getAtom(1)).thenReturn(c2);
    when(container.getAtom(2)).thenReturn(c3);
    when(container.getAtom(3)).thenReturn(c4);
    when(container.getAtom(4)).thenReturn(c5);
    when(encoder.encode(c1, container)).thenReturn(42);
    when(encoder.encode(c2, container)).thenReturn(42);
    when(encoder.encode(c3, container)).thenReturn(42);
    when(encoder.encode(c4, container)).thenReturn(42);
    when(encoder.encode(c5, container)).thenReturn(42);
    generator.generate(container);
    verify(container, times(1)).getAtomCount();
    verify(container, times(5)).getAtom(anyInt());
    verify(encoder, times(1)).encode(c1, container);
    verify(encoder, times(1)).encode(c2, container);
    verify(encoder, times(1)).encode(c3, container);
    verify(encoder, times(1)).encode(c4, container);
    verify(encoder, times(1)).encode(c5, container);
    verifyNoMoreInteractions(c1, c2, c3, c4, c5, container, encoder);
}