@Override
    public Collection<DatabasePacket> execute() throws SQLException {
        switch (packet.getType()) {
            case PREPARED_STATEMENT:
                connectionSession.getServerPreparedStatementRegistry().removePreparedStatement(packet.getName());
                break;
            case PORTAL:
                portalContext.close(packet.getName());
                break;
            default:
                throw new UnsupportedSQLOperationException(packet.getType().name());
        }
        return Collections.singleton(new PostgreSQLCloseCompletePacket());
    }
@Test
    void assertExecuteClosePortal() throws SQLException {
        when(packet.getType()).thenReturn(PostgreSQLComClosePacket.Type.PORTAL);
        String portalName = "C_1";
        when(packet.getName()).thenReturn(portalName);
        PostgreSQLComCloseExecutor closeExecutor = new PostgreSQLComCloseExecutor(portalContext, packet, connectionSession);
        Collection<DatabasePacket> actual = closeExecutor.execute();
        assertThat(actual.size(), is(1));
        assertThat(actual.iterator().next(), is(instanceOf(PostgreSQLCloseCompletePacket.class)));
        verify(portalContext).close(portalName);
    }