class KiltReformatter {

  public void reorderByKey(final FileMatcher fileMatcher, final AttachCommentsTo attachCommentsTo, final Charset charset) {
    Require.nonNull(fileMatcher);
    Require.nonNull(attachCommentsTo);
    Require.nonNull(charset);

    final Reformatter reformatter= new Reformatter(
      ReformatOptions.create()
        .with(charset)
        .with(attachCommentsTo));

    final Set<File> propertyFiles= fileMatcher.findMatchingFiles();
    LOGGER.log(Level.INFO, "Reordering entries in the following files: {}", propertyFiles);

    propertyFiles.stream().forEach(_f -> {
      final PropertyFile pf= PropertyFile.from(_f, charset);
      reformatter.reorderByKey(pf);
      pf.overwrite(_f, APRON_OPTIONS.with(charset));
    });
  }

}