@Override
    @SuppressWarnings("UseOfSystemOutOrSystemErr")
    public void run(Namespace namespace, Liquibase liquibase) throws Exception {
        final Set<Class<? extends DatabaseObject>> compareTypes = new HashSet<>();

        if (isTrue(namespace.getBoolean("columns"))) {
            compareTypes.add(Column.class);
        }
        if (isTrue(namespace.getBoolean("data"))) {
            compareTypes.add(Data.class);
        }
        if (isTrue(namespace.getBoolean("foreign-keys"))) {
            compareTypes.add(ForeignKey.class);
        }
        if (isTrue(namespace.getBoolean("indexes"))) {
            compareTypes.add(Index.class);
        }
        if (isTrue(namespace.getBoolean("primary-keys"))) {
            compareTypes.add(PrimaryKey.class);
        }
        if (isTrue(namespace.getBoolean("sequences"))) {
            compareTypes.add(Sequence.class);
        }
        if (isTrue(namespace.getBoolean("tables"))) {
            compareTypes.add(Table.class);
        }
        if (isTrue(namespace.getBoolean("unique-constraints"))) {
            compareTypes.add(UniqueConstraint.class);
        }
        if (isTrue(namespace.getBoolean("views"))) {
            compareTypes.add(View.class);
        }

        final DiffToChangeLog diffToChangeLog = new DiffToChangeLog(new DiffOutputControl());
        final Database database = liquibase.getDatabase();

        final String filename = namespace.getString("output");
        if (filename != null) {
            try (PrintStream file = new PrintStream(filename, StandardCharsets.UTF_8.name())) {
                generateChangeLog(database, database.getDefaultSchema(), diffToChangeLog, file, compareTypes);
            }
        } else {
            generateChangeLog(database, database.getDefaultSchema(), diffToChangeLog, outputStream, compareTypes);
        }
    }
@Test
    void testDumpSchemaAndData() throws Exception {
        dumpCommand.run(null, new Namespace(Stream.concat(ATTRIBUTE_NAMES.stream(), Stream.of("data"))
            .collect(Collectors.toMap(a -> a, b -> true))), existedDbConf);

        final NodeList changeSets = toXmlDocument(baos).getDocumentElement().getElementsByTagName("changeSet");
        assertCreateTable((Element) changeSets.item(0));
        assertInsertData((Element) changeSets.item(1));
    }