### Question:
SourceTargetHelper { public static long getPathSize(Configuration conf, Path path) throws IOException { return getPathSize(FileSystem.get(conf), path); }  static long getPathSize(Configuration conf, Path path); static long getPathSize(FileSystem fs, Path path);  }### Answer:
@Test public void testGetNonexistentPathSize() throws Exception { File tmp = File.createTempFile("pathsize", ""); Path tmpPath = new Path(tmp.getAbsolutePath()); tmp.delete(); FileSystem fs = FileSystem.getLocal(new Configuration()); assertEquals(-1L, SourceTargetHelper.getPathSize(fs, tmpPath)); }
@Test public void testGetNonExistentPathSize_NonExistantPath() throws IOException { FileSystem mockFs = new MockFileSystem(); assertEquals(-1L, SourceTargetHelper.getPathSize(mockFs, new Path("does/not/exist"))); }