import org.junit.Assert;
import org.junit.Test;

import java.io.File;

public class FileTest {

    @Test
    public void test1() {
        File parent = new File("//some-dir//");
        Assert.assertEquals("/some-dir", parent.getAbsolutePath()); // passed
    }
    @Test
    public void test2() {
        File parent = new File("//some-dir//");
        Assert.assertEquals("/some-dir/some-file", new File(parent, "//some-file//").getAbsolutePath()); // passed
    }
    @Test
    public void test3() {
        File parent = new File("//some-dir//");
        Assert.assertEquals("/some-dir/some-file", new File(parent, "some-file").getAbsolutePath()); // passed
    }
    @Test
    public void test4() {
        File parent = new File("//some-dir//");
        // This assert fails, actual value contains doubled slash: /some-dir//some-file"
        Assert.assertEquals("/some-dir/some-file", new File(new File(parent, "/"), "some-file").getAbsolutePath());
    }

}