@Test
public void testDifficultyWithExplosionShouldBeImpactedByBlockTimestamp() throws Exception {

    ByzantiumConfig byzantiumConfig = new ByzantiumConfig(new TestBlockchainConfig());
    BlockHeader parent = new BlockHeaderBuilder(new byte[]{11, 12}, 2_500_000, 8_388_608)
            .withTimestamp(0)
            .build();
    BlockHeader current = new BlockHeaderBuilder(parent.getHash(), 2_500_001, 8_388_608)
            .withTimestamp(10 * 60) // 10 minutes later, longer time: lowers difficulty
            .build();
    BigInteger difficulty = byzantiumConfig.calcDifficulty(current, parent);
    assertEquals(BigInteger.valueOf(8126464), difficulty);
    parent = new BlockHeaderBuilder(new byte[]{11, 12}, 2_500_000, 8_388_608)
            .withTimestamp(0)
            .build();
    current = new BlockHeaderBuilder(parent.getHash(), 2_500_001, 8_388_608)
            .withTimestamp(5) // 5 seconds later, shorter time: higher difficulty
            .build();
    difficulty = byzantiumConfig.calcDifficulty(current, parent);
    assertEquals(BigInteger.valueOf(8396800), difficulty);
}