double (final int value) { final ThreadLocalRandom rnd = ThreadLocalRandom.current(); final int randomValue100 = rnd.nextInt(100); if (value > currentEstimation && randomValue100 <= targetPercentileToEstimate) { currentEstimation += step; } else if (value < currentEstimation && randomValue100 > targetPercentileToEstimate) { currentEstimation -= step; } return currentEstimation(); }