### Question:
TargetPeerRange { public int getRandomlySelectedPeersToDrop( final int currentRandomlySelectedPeerCount, final int currentTotalPeerCount) { final int totalPeersToDrop = getPeersToDrop(currentTotalPeerCount); if (totalPeersToDrop == 0) { return 0; } return currentRandomlySelectedPeerCount > minimumRandomlySelectedPeerCount ? Math.min( currentRandomlySelectedPeerCount - minimumRandomlySelectedPeerCount, totalPeersToDrop) : 0; } TargetPeerRange(
      final int addPeersWhenLessThan,
      final int dropPeersWhenGreaterThan,
      final int minimumRandomlySelectedPeerCount); int getPeersToAdd(final int currentPeerCount); int getPeersToDrop(final int currentPeerCount); int getRandomlySelectedPeersToAdd(final int currentRandomlySelectedPeerCount); int getRandomlySelectedPeersToDrop(
      final int currentRandomlySelectedPeerCount, final int currentTotalPeerCount);  }### Answer:
@Test void shouldDropRandomlySelectedPeerWhenTotalPeerCountAndMinimumExceeded() { assertThat(new TargetPeerRange(5, 10, 3).getRandomlySelectedPeersToDrop(5, 15)).isEqualTo(2); }
@Test void shouldOnlyDropEnoughRandomlySelectedPeersToReachTheTargetPeerCountRange() { assertThat(new TargetPeerRange(5, 10, 3).getRandomlySelectedPeersToDrop(10, 15)).isEqualTo(5); }
@Test void shouldNotDropRandomlySelectedPeersWhenEqualToMinimum() { assertThat(new TargetPeerRange(5, 10, 3).getRandomlySelectedPeersToDrop(3, 15)).isZero(); }
@Test void shouldNotDropRandomlySelectedPeersWhenBelowMinimum() { assertThat(new TargetPeerRange(5, 10, 3).getRandomlySelectedPeersToDrop(2, 15)).isZero(); }