void (@NotNull String filePath, @NotNull String actual, boolean preserveSpaces) { try { File file = new File(filePath); if (preserveSpaces) { try { actual = preserveSpacesFromFile(file, actual); } catch (Throwable e) { //noinspection UseOfSystemOutOrSystemErr System.err.println("Failed to preserve spaces: " + e.getMessage()); } } FileUtil.writeToFile(file, actual); } catch (IOException e) { throw new AssertionError(e); } }