InkDropSizeLimiter { float getRadius() { return constrain(RainbowMath.map(brushOptionsPreferences.getBrushSizePercentage(), PERCENTAGE_MIN, PERCENTAGE_MAX, RADIUS_MIN, RADIUS_MAX)); } InkDropSizeLimiter(BrushOptionsPreferences brushOptionsPreferences); static InkDropSizeLimiter newInstance(BrushOptionsPreferences brushOptionsPreferences);  }
@Test public void testThatWhenRadiusIsLowerThatMinimumThenMinimumIsReturned() { givenAPercentageForAVeryLowRadius(); assertThat(inkDropSizeLimiter.getRadius()).isEqualTo(INK_DROP_MIN_RADIUS); }
@Test public void testThatWhenRadiusIsGreaterThatMaximumThenMaximumIsReturned() { givenAPercentageForAVeryHighRadius(); assertThat(inkDropSizeLimiter.getRadius()).isEqualTo(INK_DROP_MAX_RADIUS); }
@Test public void testThatWhenRadiusIsBetweenMaxAndMinRadiusIsReturned() { givenAPercentageForARadiusInBetween(); assertThat(inkDropSizeLimiter.getRadius()).isLessThan(INK_DROP_MAX_RADIUS).isGreaterThan(INK_DROP_MIN_RADIUS); }