@Override
    public void close() {
        if (this.payloadStreamObserver != null) {
            try {
                payloadStreamObserver.onCompleted();
            } catch (Throwable ignored) {
            }
        }
        
        if (this.channel != null && !channel.isShutdown()) {
            try {
                this.channel.shutdownNow();
            } catch (Throwable ignored) {
            }
        }
    }
@Test
    void testCloseWithException() {
        doThrow(new RuntimeException("test")).when(payloadStreamObserver).onCompleted();
        when(channel.shutdownNow()).thenThrow(new RuntimeException("test"));
        connection.close();
        // don't throw any exception
    }