@Override
    public YamlProcess swapToYamlConfiguration(final Process data) {
        YamlProcess result = new YamlProcess();
        result.setId(data.getId());
        result.setStartMillis(data.getStartMillis());
        result.setSql(data.getSql());
        result.setDatabaseName(data.getDatabaseName());
        result.setUsername(data.getUsername());
        result.setHostname(data.getHostname());
        result.setTotalUnitCount(data.getTotalUnitCount().get());
        result.setCompletedUnitCount(data.getCompletedUnitCount().get());
        result.setIdle(data.isIdle());
        result.setInterrupted(data.isInterrupted());
        return result;
    }
@Test
    void assertSwapToYamlConfiguration() {
        String processId = new UUID(ThreadLocalRandom.current().nextLong(), ThreadLocalRandom.current().nextLong()).toString().replace("-", "");
        ExecutionGroupReportContext reportContext = new ExecutionGroupReportContext(processId, "foo_db", new Grantee("root", "localhost"));
        ExecutionGroupContext<? extends SQLExecutionUnit> executionGroupContext = new ExecutionGroupContext<>(Collections.emptyList(), reportContext);
        Process process = new Process("SELECT 1", executionGroupContext);
        YamlProcess actual = new YamlProcessSwapper().swapToYamlConfiguration(process);
        assertNotNull(actual.getId());
        assertThat(actual.getStartMillis(), lessThanOrEqualTo(System.currentTimeMillis()));
        assertThat(actual.getSql(), is("SELECT 1"));
        assertThat(actual.getDatabaseName(), is("foo_db"));
        assertThat(actual.getUsername(), is("root"));
        assertThat(actual.getHostname(), is("localhost"));
        assertThat(actual.getCompletedUnitCount(), is(0));
        assertThat(actual.getTotalUnitCount(), is(0));
        assertFalse(actual.isIdle());
    }