@Test
public void testMixed() {

    CompositeEthereumListener listener = new CompositeEthereumListenerMock();
    EthashRule rule = new EthashRule(EthashRule.Mode.mixed, EthashRule.ChainType.main, listener);
    // trigger ethash cache
    listener.onBlock(dummySummaryNum_1, true);
    // check mixed mode randomness
    boolean fullCheckTriggered = false;
    boolean partialCheckTriggered = false;
    for (int i = 0; i < 100; i++) {
        if (Success != rule.validate(partlyValidHeader)) {
            fullCheckTriggered = true;
        } else {
            partialCheckTriggered = true;
        }
        if (partialCheckTriggered & fullCheckTriggered) break;
    }
    assertTrue(fullCheckTriggered);
    assertTrue(partialCheckTriggered);
    // trigger onSyncDone
    listener.onSyncDone(EthereumListener.SyncState.COMPLETE);
    // check that full verification is done on each run in strict mode
    for (int i = 0; i < 100; i++) {
        assertNotEquals(Success, rule.validate(partlyValidHeader));
    }
}