@Test
public void testEncode() {

    AtomEncoder e1 = mock(AtomEncoder.class);
    AtomEncoder e2 = mock(AtomEncoder.class);
    AtomHashGenerator generator = new HashGeneratorMaker().depth(0).encode(e1).encode(e2).atomic();
    List<AtomEncoder> encoders = getEncoders((BasicAtomHashGenerator) generator);
    assertThat(encoders.size(), is(2));
    assertThat(encoders.get(0), is(e1));
    assertThat(encoders.get(1), is(e2));
    generator = new HashGeneratorMaker().depth(0).encode(e2).encode(e1).atomic();
    encoders = getEncoders((BasicAtomHashGenerator) generator);
    assertThat(encoders.size(), is(2));
    assertThat(encoders.get(0), is(e2));
    assertThat(encoders.get(1), is(e1));
}