AbstractClientConnection { @VisibleForTesting final OptionalLong checkTimeout(final long now) { lock.lock(); try { return lockedCheckTimeout(now); } finally { lock.unlock(); } } private  AbstractClientConnection(final AbstractClientConnection<T> oldConn, final TransmitQueue newQueue,
            final String backendName);   AbstractClientConnection(final ClientActorContext context, final Long cookie, final String backendName,
            final int queueDepth);   AbstractClientConnection(final AbstractClientConnection<T> oldConn);   AbstractClientConnection(final AbstractClientConnection<T> oldConn, final T newBackend,
            final int queueDepth); final ClientActorContext context(); final @NonNull Long cookie(); final ActorRef localActor(); final long currentTime(); final void sendRequest(final Request<?, ?> request, final Consumer<Response<?, ?>> callback); final void enqueueRequest(final Request<?, ?> request, final Consumer<Response<?, ?>> callback,
            final long enqueuedTicks); final void enqueueEntry(final ConnectionEntry entry, final long now); abstract Optional<T> getBackendInfo(); @Override final String toString(); static final long DEFAULT_BACKEND_ALIVE_TIMEOUT_NANOS; static final long DEFAULT_REQUEST_TIMEOUT_NANOS; static final long DEFAULT_NO_PROGRESS_TIMEOUT_NANOS; }
@Test public void testCheckTimeoutEmptyQueue() { assertEquals(OptionalLong.empty(), connection.checkTimeout(context.ticker().read())); }
@Test public void testCheckTimeout() { final Consumer<Response<?, ?>> callback = mock(Consumer.class); connection.sendRequest(createRequest(replyToProbe.ref()), callback); final long now = context.ticker().read(); final OptionalLong timeout = connection.checkTimeout(now); assertTrue(timeout.isPresent()); }