### Question:
FileConvert extends Thread { public static void main(final String[] args) { WaarpLoggerFactory .setDefaultFactoryIfNotSame(new WaarpSlf4JLoggerFactory(null)); if (logger == null) { logger = WaarpLoggerFactory.getLogger(FileConvert.class); } final ArrayList<File> files = new ArrayList<File>(); boolean unix2dos = false; boolean dos2unix = false; boolean recursive = false; File tmpDir = null; for (int i = 0; i < args.length; i++) { if (Pattern .compile("^-(u|-unix2dos|-unixtodos)$", Pattern.CASE_INSENSITIVE) .matcher(args[i]).matches()) { unix2dos = true; } else if (Pattern .compile("^-(d|-dos2unix|-dostounix)$", Pattern.CASE_INSENSITIVE) .matcher(args[i]).matches()) { dos2unix = true; } else if (Pattern.compile("^-(r|-recursive)$", Pattern.CASE_INSENSITIVE) .matcher(args[i]).matches()) { recursive = true; } else if (Pattern.compile("^-(t|-temporary)$", Pattern.CASE_INSENSITIVE) .matcher(args[i]).matches()) { tmpDir = new File(args[++i]); } else { files.add(new File(args[i])); } } if (unix2dos && dos2unix) { syntax(); System.exit(1); } if (!unix2dos && !dos2unix) { syntax(); System.exit(1); } final FileConvert fileConvert = new FileConvert(files, unix2dos, recursive, tmpDir); fileConvert.run(); } FileConvert(final List<File> files, final boolean unix2dos,
                     final boolean recursive, final File tmpDir); static void main(final String[] args); @Override void run(); boolean convert(final File input, final boolean unix2dos);  }### Answer:
@Test public void testCharsetsUtil() throws IOException { final File fileto = new File("/tmp/to.txt"); final File filefrom = new File("/tmp/from.txt"); FileTestUtils.createTestFile(filefrom, 10); final String[] args = { "-to", "/tmp/to.txt", WaarpStringUtils.UTF_8, "-from", "/tmp/from.txt", WaarpStringUtils.UTF_8 }; CharsetsUtil.main(args); assertTrue(fileto.exists()); }