FileIOUtils { public static long readNumberFromFile(final Path filePath) throws IOException, NumberFormatException { final List<String> allLines = Files.readAllLines(filePath); if (!allLines.isEmpty()) { return Long.parseLong(allLines.get(0)); } else { throw new NumberFormatException("unable to parse empty file " + filePath.toString()); } }  static boolean isDirWritable(final File dir); static boolean isValidDirectory(File directory); static void deleteDirectorySilently(final File dir); static File getDirectory(File parentDirectory, String folderName); static void moveFiles(File sourceDirectory, File destinationDiretory, String fileNamePattern); static void dumpNumberToFile(final Path filePath, final long num); static long readNumberFromFile(final Path filePath); static String getSourcePathFromClass(final Class<?> containedClass); static String getCanonicalPath(final File f); static Props loadOutputFileProps(final File file); static File createOutputPropsFile(final String prefix,
      final String suffix, final String workingDir); static int createDeepHardlink(final File sourceDir, final File destDir); static Pair<Integer, Integer> readUtf8File(final File file, final int offset,
      final int length, final OutputStream stream); static LogData readUtf8File(final File file, final int fileOffset, final int length); static JobMetaData readUtf8MetaDataFile(final File file, final int fileOffset,
      final int length); static Pair<Integer, Integer> getUtf8Range(final byte[] buffer, final int offset,
      final int length);  }
@Test public void testDumpNumberToFileAndReadFromFile() throws IOException { final String fileName = "number"; final long num = 94127; final File fileToDump = dumpNumberToTempFile(fileName, num); assertThat(FileIOUtils.readNumberFromFile(fileToDump.toPath())).isEqualTo(num); }