public class MemoryFolderTest {
@Test
public void testGetParentWithLeadingAndTrailingSlash() {
MemoryFileSystem mfs = new MemoryFileSystem();
assertEquals( "", new MemoryFolder( mfs, "/src" ).getParent().getPath().toPortableString() );
assertEquals( "", new MemoryFolder( mfs, "src/" ).getParent().getPath().toPortableString() );
assertEquals( "", new MemoryFolder( mfs, "/src/" ).getParent().getPath().toPortableString() );
assertEquals( "src", new MemoryFolder( mfs, "/src/main" ).getParent().getPath().toPortableString() );
assertEquals( "src", new MemoryFolder( mfs, "src/main/" ).getParent().getPath().toPortableString() );
assertEquals( "src", new MemoryFolder( mfs, "/src/main/" ).getParent().getPath().toPortableString() );
assertEquals( "src/main", new MemoryFolder( mfs, "/src/main/java" ).getParent().getPath().toPortableString() );
assertEquals( "src/main", new MemoryFolder( mfs, "src/main/java/" ).getParent().getPath().toPortableString() );
assertEquals( "src/main", new MemoryFolder( mfs, "/src/main/java/" ).getParent().getPath().toPortableString() );
}