    @Test
    public void toPathTest() throws IOException {

        Path pathObj = Files.createTempFile("path", ".tmp");
        File fileObj = File.createTempFile("file", ".tmp");
        URI uriObj = URI.create("file:/tmp");
        URL urlFileObj = new URL("file:/tmp");

        try {
            //convert to Path
            assertNull(IOUtilities.toPath(null));
            assertSame(pathObj, IOUtilities.toPath(pathObj)); //should be same reference
            assertEquals(fileObj.toPath(), IOUtilities.toPath(fileObj));
            assertEquals(Paths.get(uriObj), IOUtilities.toPath(uriObj));
            assertEquals(Paths.get(uriObj), IOUtilities.toPath(urlFileObj));

            //valid string Object
            assertEquals(Paths.get("/tmp"), IOUtilities.toPath("/tmp"));
            assertEquals(Paths.get("/tmp"), IOUtilities.toPath("file:/tmp"));
            assertEquals(Paths.get("/tmp my file"), IOUtilities.toPath("file:/tmp my file"));
            assertEquals(Paths.get("./tmp"), IOUtilities.toPath("./tmp"));
            assertEquals(Paths.get("./tmp my file"), IOUtilities.toPath("./tmp my file"));

            try {
                IOUtilities.toPath("http://some/url");
                fail("Should raise FileSystemNotFoundException because http FileSystem is not supported by default");
            } catch (FileSystemNotFoundException e) {
                //normal exception
            }

            try {
                IOUtilities.toPath(new URL("http://some/url"));
                fail("Should raise FileSystemNotFoundException because http FileSystem is not supported by default");
            } catch (IOException e) {
                //normal exception
            }

            try {
                IOUtilities.toPath(1);
                fail("Should raise IllegalArgumentException");
            } catch (IllegalArgumentException e) {
                //normal exception
            }
        } finally {
            //clean
            Files.delete(pathObj);
            fileObj.delete();
        }
    }