### Question:
ReservoirTraceStorageStrategy implements TraceStorageStrategy { @Override public RequestTrace getTraceForRemoval(Collection<RequestTrace> traces, int maxSize, RequestTrace traceToRemove) { if (traces.size() <= maxSize) { return null; } return traceToRemove != null && traces.contains(traceToRemove) ? traceToRemove : findRandomTrace(traces); } ReservoirTraceStorageStrategy(); protected  ReservoirTraceStorageStrategy(long seed); @Override RequestTrace getTraceForRemoval(Collection<RequestTrace> traces, int maxSize, RequestTrace traceToRemove);  }### Answer:
@Test public void test_random_chance_of_trace_removal() { final String errorMessage = "Incorrect trace removed, trace to be removed isn't random."; assertEquals(errorMessage, "5", strategy.getTraceForRemoval(traces, 0, null).getTraceSpans().getFirst().getEventName()); assertEquals(errorMessage, "8", strategy.getTraceForRemoval(traces, 0, null).getTraceSpans().getFirst().getEventName()); assertEquals(errorMessage, "7", strategy.getTraceForRemoval(traces, 0, null).getTraceSpans().getFirst().getEventName()); assertEquals(errorMessage, "3", strategy.getTraceForRemoval(traces, 0, null).getTraceSpans().getFirst().getEventName()); assertEquals(errorMessage, "4", strategy.getTraceForRemoval(traces, 0, null).getTraceSpans().getFirst().getEventName()); }