/** Next high number guess test. */
 @Test
 public void nextHighNumberGuessTest() {
   when(rangeGenerator.generateRange(6)).thenReturn(new Range(64, 128));
   long nextHighNumber = nextGuess.nextHighNumber(64);
   assertThat(nextHighNumber, is(128L));
   verify(rangeGenerator).generateRange(6);
 }
  /** Next high number fine grained guess test. */
  @Test
  public void nextHighNumberFineGrainedGuessTest() {
    ReflectionTestUtils.setField(nextGuess, "fineGrainedGuesser", fineGrainedGuess);

    int currentNum = 27;
    when(fineGrainedGuess.moveToNextRange(currentNum)).thenReturn(false);
    when(fineGrainedGuess.nextHighNumber(27)).thenReturn(29L);
    long nextHighNumber = nextGuess.nextHighNumber(currentNum);
    assertThat(nextHighNumber, is(29L));

    verify(rangeGenerator, never()).generateRange(Matchers.anyInt());
    verify(fineGrainedGuess, times(1)).moveToNextRange(currentNum);
    verify(fineGrainedGuess, times(1)).nextHighNumber(currentNum);
  }