static String createRulesFile(String file, final List<String> rules) throws IOException {
    cleanup(file);
    Path path = Files.createFile(FileSystems.getDefault().getPath(file));
    return Files.write(path, rules, StandardCharsets.UTF_8).toString();
  }
Create rule file with the given rules.
@param file Name of file to write rules into.
@return Full file name of the rules file which is <code>dir</code> + DEFAULT_RULES_FILE_NAME.
hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/HeterogeneousCostRulesTestHelper.java