@SuppressWarnings("ResultOfMethodCallIgnored")
    @SneakyThrows(InterruptedException.class)
    public void doAwait(final ChannelHandlerContext context) {
        while (!context.channel().isWritable() && context.channel().isActive()) {
            context.flush();
            lock.lock();
            try {
                condition.await(DEFAULT_TIMEOUT_MILLISECONDS, TimeUnit.MILLISECONDS);
            } finally {
                lock.unlock();
            }
        }
    }
@Test
    void assertDoAwait() throws NoSuchFieldException, IllegalAccessException {
        when(channel.isWritable()).thenReturn(false);
        when(channel.isActive()).thenReturn(true);
        when(channelHandlerContext.channel()).thenReturn(channel);
        ExecutorService executorService = Executors.newFixedThreadPool(1);
        executorService.submit(() -> resourceLock.doAwait(channelHandlerContext));
        Awaitility.await().pollDelay(200L, TimeUnit.MILLISECONDS).until(() -> true);
        Plugins.getMemberAccessor().set(ResourceLock.class.getDeclaredField("condition"), resourceLock, new ReentrantLock().newCondition());
        verify(resourceLock, times(1)).doAwait(channelHandlerContext);
    }