PathHolder implements Serializable { public Path getPath() { return Paths.get(toString()); } PathHolder(Path path);  PathHolder(String pathString); @Override boolean equals(Object object); Path getPath(); @Override int hashCode(); @Override String toString();  }
@Test public void testGetPath() { Path path = Paths.get("testFile"); PathHolder pathHolder = new PathHolder(path); Assert.assertEquals(path, pathHolder.getPath()); }