@Override
    public Collection<DatabasePacket> execute() throws SQLException {
        List<DatabasePacket> result = new LinkedList<>();
        for (CommandExecutor each : executors) {
            try {
                result.addAll(each.execute());
            } finally {
                each.close();
            }
        }
        return Collections.singleton(new PostgreSQLAggregatedResponsesPacket(result));
    }
@Test
    void assertExecute() throws SQLException {
        int commandCount = 16;
        List<CommandExecutor> executors = new ArrayList<>(commandCount);
        for (int i = 0; i < commandCount; i++) {
            CommandExecutor executor = mock(CommandExecutor.class);
            when(executor.execute()).thenReturn(Collections.singleton(mock(PostgreSQLPacket.class)));
            executors.add(executor);
        }
        PostgreSQLAggregatedCommandExecutor actualExecutor = new PostgreSQLAggregatedCommandExecutor(executors);
        Collection<DatabasePacket> actualPackets = actualExecutor.execute();
        assertThat(actualPackets.size(), is(1));
        assertThat(actualPackets.iterator().next(), instanceOf(PostgreSQLAggregatedResponsesPacket.class));
    }