### Question:
CliqueDifficultyCalculator implements DifficultyCalculator { @Override public BigInteger nextDifficulty( final long time, final BlockHeader parent, final ProtocolContext context) { final Address nextProposer = CliqueHelpers.getProposerForBlockAfter( parent, context.getConsensusState(CliqueContext.class).getVoteTallyCache()); return nextProposer.equals(localAddress) ? IN_TURN_DIFFICULTY : OUT_OF_TURN_DIFFICULTY; } CliqueDifficultyCalculator(final Address localAddress); @Override BigInteger nextDifficulty(
      final long time, final BlockHeader parent, final ProtocolContext context);  }### Answer:
@Test public void inTurnValidatorProducesDifficultyOfTwo() { final CliqueDifficultyCalculator calculator = new CliqueDifficultyCalculator(localAddr); final BlockHeader parentHeader = blockHeaderBuilder.number(1).buildHeader(); assertThat(calculator.nextDifficulty(0, parentHeader, cliqueProtocolContext)) .isEqualTo(BigInteger.valueOf(2)); }
@Test public void outTurnValidatorProducesDifficultyOfOne() { final CliqueDifficultyCalculator calculator = new CliqueDifficultyCalculator(localAddr); final BlockHeader parentHeader = blockHeaderBuilder.number(2).buildHeader(); assertThat(calculator.nextDifficulty(0, parentHeader, cliqueProtocolContext)) .isEqualTo(BigInteger.valueOf(1)); }