### Question:
DefaultRandomValues implements RandomValues { @Override public boolean randomBoolean() { return random.nextBoolean(); } DefaultRandomValues(final Random random); @Override boolean randomBoolean(); @Override int randomInteger(final int lower, final int upper); @Override long randomLong(final long lower, final long upper); @Override double randomDouble(final double lower, final double upper); @Override double randomDouble(final double lower, final double upper, final int scale); @Override byte randomByte(final byte lower, final byte upper); @Override byte[] randomBytes(final int length); @Override short randomShort(final short lower, final short upper);  }### Answer:
@Test public void returnsNextRandomBoolean() { final boolean expectedBoolean = new Random().nextBoolean(); final Random stubRandom = new Random() { @Override public boolean nextBoolean() { return expectedBoolean; } }; final boolean actualBoolean = new DefaultRandomValues(stubRandom).randomBoolean(); assertThat(actualBoolean).isEqualTo(expectedBoolean); }