private static void nativeMemory(XmlGenerator gen, NativeMemoryConfig nativeMemory) {
        gen.open("native-memory", "enabled", nativeMemory.isEnabled(),
                "allocator-type", nativeMemory.getAllocatorType())
                .node("capacity", null, "value", nativeMemory.getCapacity().getValue(),
                        "unit", nativeMemory.getCapacity().getUnit())
                .node("min-block-size", nativeMemory.getMinBlockSize())
                .node("page-size", nativeMemory.getPageSize())
                .node("metadata-space-percentage", nativeMemory.getMetadataSpacePercentage());

        PersistentMemoryConfig pmemConfig = nativeMemory.getPersistentMemoryConfig();
        List<PersistentMemoryDirectoryConfig> directoryConfigs = pmemConfig.getDirectoryConfigs();
        gen.open("persistent-memory",
                "enabled", pmemConfig.isEnabled(),
                "mode", pmemConfig.getMode().name());
        if (!directoryConfigs.isEmpty()) {
            gen.open("directories");
            for (PersistentMemoryDirectoryConfig dirConfig : directoryConfigs) {
                if (dirConfig.isNumaNodeSet()) {
                    gen.node("directory", dirConfig.getDirectory(),
                            "numa-node", dirConfig.getNumaNode());
                } else {
                    gen.node("directory", dirConfig.getDirectory());
                }
            }
            gen.close();
        }
        gen.close().close();
    }
@Test
    public void nativeMemory() {
        NativeMemoryConfig expected = new NativeMemoryConfig();
        expected.setEnabled(true)
                .setAllocatorType(MemoryAllocatorType.STANDARD)
                .setMetadataSpacePercentage(70)
                .setMinBlockSize(randomInt())
                .setPageSize(randomInt())
                .setCapacity(new Capacity(randomInt(), MemoryUnit.BYTES));
        clientConfig.setNativeMemoryConfig(expected);

        NativeMemoryConfig actual = newConfigViaGenerator().getNativeMemoryConfig();
        assertEquals(clientConfig.getNativeMemoryConfig(), actual);
    }