Browse souce code repository at: https://github.com/jjYBdx4IL/java-evaluation/blob/master/src/test/java/tests/java/nio/file/PathTest.java
package tests.java.nio.file;

import java.nio.file.Path;
import java.nio.file.Paths;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;

/**
 *
 * @author jjYBdx4IL
 */
public class PathTest {

    @Test
    public void testResolve() {
        Path root = Paths.get("/root");

        assertEquals(Paths.get("/root/rel"), root.resolve(Paths.get("rel")));
        assertEquals(Paths.get("/rel"), root.resolve(Paths.get("/rel")));
    }

    @Test
    public void testRelativize() {
        Path root = Paths.get("/root");
        assertEquals(Paths.get("rel"), root.relativize(Paths.get("/root/rel")));
        assertEquals(Paths.get("../rel"), root.relativize(Paths.get("/rel")));
        try {
            root.relativize(Paths.get("rel"));
            fail();
        } catch (IllegalArgumentException ex) {
        }
    }
}
-------------------------------------------------------------------------------
Test set: tests.java.nio.file.PathTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in tests.java.nio.file.PathTest
testRelativize  Time elapsed: 0 s
testResolve  Time elapsed: 0 s