public static boolean writeDataObject(String path, Object dataMap) {
        Yaml yaml = new Yaml();
        try (PrintWriter pw = new PrintWriter(path, "UTF-8")) {
            String dumpAsMap = yaml.dumpAsMap(dataMap);
            pw.print(dumpAsMap);
            pw.flush();
        } catch (Exception e) {
            throw new AclException(e.getMessage(), e);
        }
        return true;
    }
@Test
    public void writeDataObject2YamlFileTest() throws IOException {
        String targetFileName = randomTmpFile();
        File transport = new File(targetFileName);
        Assert.assertTrue(transport.createNewFile());
        transport.deleteOnExit();

        PlainAccessData aclYamlMap = new PlainAccessData();

        // For globalWhiteRemoteAddrs element in acl yaml config file
        List<String> globalWhiteRemoteAddrs = new ArrayList<>();
        globalWhiteRemoteAddrs.add("10.10.103.*");
        globalWhiteRemoteAddrs.add("192.168.0.*");
        aclYamlMap.setGlobalWhiteRemoteAddresses(globalWhiteRemoteAddrs);

        // For accounts element in acl yaml config file
        List<PlainAccessConfig> accounts = new ArrayList<>();
        PlainAccessConfig accountsMap = new PlainAccessConfig() {
            {
                setAccessKey("RocketMQ");
                setSecretKey("12345678");
                setWhiteRemoteAddress("whiteRemoteAddress");
                setAdmin(true);
            }
        };
        accounts.add(accountsMap);
        aclYamlMap.setAccounts(accounts);
        Assert.assertTrue(AclUtils.writeDataObject(targetFileName, aclYamlMap));
    }