@Nullable
    public final RecordedRequest takeRequest(int amount, TimeUnit unit) {
        requireNonNull(unit, "unit");
        boolean interrupted = false;
        try {
            long remainingNanos = unit.toNanos(amount);
            final long end = System.nanoTime() + remainingNanos;

            while (true) {
                try {
                    // BlockingQueue treats negative timeouts just like zero.
                    return recordedRequests.poll(remainingNanos, NANOSECONDS);
                } catch (InterruptedException e) {
                    interrupted = true;
                    remainingNanos = end - System.nanoTime();
                }
            }
        } finally {
            if (interrupted) {
                Thread.currentThread().interrupt();
            }
        }
    }
Returns the next {@link RecordedRequest} the server received. Call this method multiple times to retrieve
the requests, in order. Will block the given amount of time waiting for a request.
junit5/src/main/java/com/linecorp/armeria/testing/junit5/server/mock/MockWebServerExtension.java