@Test
public void testCacheDirect() {

    EthashValidationHelperMock helper = new EthashValidationHelperMock(EthashValidationHelper.CacheOrder.direct);
    CompositeEthereumListener listener = new CompositeEthereumListenerMock();
    EthashRule rule = new EthashRule(EthashRule.Mode.mixed, EthashRule.ChainType.direct, listener);
    rule.ethashHelper = helper;
    // trigger cache
    for (int i = 0; i < 100; i++) {
        rule.validate(validHeader);
    }
    // must be triggered each verification attempt, in spite of mixed mode
    assertEquals(100, helper.preCacheCounter);
}