### Question:
RelativePathResolver { public String getRelativePathToFile(String callerPath, String targetPath) { LinkedList<String> callerPathElements = getLinkedListOfPathElements(callerPath); LinkedList<String> targetPathElements = getLinkedListOfPathElements(targetPath); List<String> relativePathToFile = getRelativePathToFile(callerPathElements, targetPathElements); return generateRelativePathString(relativePathToFile); }  String getRelativePathAsFile(Class originClass,Class targetClass, String extension); String getRelativePathToFile(String callerPath, String targetPath); String getPathOf(Class aClass, String extension);  }### Answer:
@Test public void testGetRelativePathFromOtherDirectory() { RelativePathResolver tested = new RelativePathResolver(); String relativePathToFile = tested.getRelativePathToFile("first/second/file1.bin", "first/third/file2.bin"); Assert.assertEquals("../third/file2.bin", relativePathToFile); }
@Test public void testGetRelativePathFromOuterDirectory() { RelativePathResolver tested = new RelativePathResolver(); String relativePathToFile = tested.getRelativePathToFile("first/second/third/file1.bin", "first/second/file2.bin"); Assert.assertEquals("../file2.bin", relativePathToFile); }
@Test public void testGetRelativePathFromRoot() { RelativePathResolver tested = new RelativePathResolver(); String relativePathToFile = tested.getRelativePathToFile("file1.bin", "first/third/file2.bin"); Assert.assertEquals("first/third/file2.bin", relativePathToFile); }
@Test public void testGetRelativePathFromInnerDirectory() { RelativePathResolver tested = new RelativePathResolver(); String relativePathToFile = tested.getRelativePathToFile("first/file1.bin", "first/third/file2.bin"); Assert.assertEquals("third/file2.bin", relativePathToFile); }