void (String[] finalOutputs, String removeSuffix, String addSuffix) { for (String output : finalOutputs) { for (String res : RESOURCES_TO_MASK) { File file = new File(output, res + removeSuffix); if (file.exists()) { //noinspection ResultOfMethodCallIgnored file.renameTo(new File(output, res + addSuffix)); } } } }