public static String makePath(String parent, String child) {
        // 2 is the maximum number of additional path separators inserted
        int maxPathLength = nullableStringLength(parent) + nullableStringLength(child) + 2;
        // Avoid internal StringBuilder's buffer reallocation by specifying the max path length
        StringBuilder path = new StringBuilder(maxPathLength);

        joinPath(path, parent, child);

        return path.toString();
    }
@SuppressWarnings("NullArgumentToVariableArgMethod")
    @Test
    public void testMakePath() {
        assertEquals(ZKPaths.makePath(null, "/"), "/");
        assertEquals(ZKPaths.makePath("", null), "/");
        assertEquals(ZKPaths.makePath("/", null), "/");
        assertEquals(ZKPaths.makePath(null, null), "/");

        assertEquals(ZKPaths.makePath("/", "/"), "/");
        assertEquals(ZKPaths.makePath("", "/"), "/");
        assertEquals(ZKPaths.makePath("/", ""), "/");
        assertEquals(ZKPaths.makePath("", ""), "/");

        assertEquals(ZKPaths.makePath("foo", ""), "/foo");
        assertEquals(ZKPaths.makePath("foo", "/"), "/foo");
        assertEquals(ZKPaths.makePath("/foo", ""), "/foo");
        assertEquals(ZKPaths.makePath("/foo", "/"), "/foo");

        assertEquals(ZKPaths.makePath("foo", null), "/foo");
        assertEquals(ZKPaths.makePath("foo", null), "/foo");
        assertEquals(ZKPaths.makePath("/foo", null), "/foo");
        assertEquals(ZKPaths.makePath("/foo", null), "/foo");

        assertEquals(ZKPaths.makePath("", "bar"), "/bar");
        assertEquals(ZKPaths.makePath("/", "bar"), "/bar");
        assertEquals(ZKPaths.makePath("", "/bar"), "/bar");
        assertEquals(ZKPaths.makePath("/", "/bar"), "/bar");

        assertEquals(ZKPaths.makePath(null, "bar"), "/bar");
        assertEquals(ZKPaths.makePath(null, "bar"), "/bar");
        assertEquals(ZKPaths.makePath(null, "/bar"), "/bar");
        assertEquals(ZKPaths.makePath(null, "/bar"), "/bar");

        assertEquals(ZKPaths.makePath("foo", "bar"), "/foo/bar");
        assertEquals(ZKPaths.makePath("/foo", "bar"), "/foo/bar");
        assertEquals(ZKPaths.makePath("foo", "/bar"), "/foo/bar");
        assertEquals(ZKPaths.makePath("/foo", "/bar"), "/foo/bar");
        assertEquals(ZKPaths.makePath("/foo", "bar/"), "/foo/bar");
        assertEquals(ZKPaths.makePath("/foo/", "/bar/"), "/foo/bar");

        assertEquals(ZKPaths.makePath("foo", "bar", "baz"), "/foo/bar/baz");
        assertEquals(ZKPaths.makePath("foo", "bar", "baz", "qux"), "/foo/bar/baz/qux");
        assertEquals(ZKPaths.makePath("/foo", "/bar", "/baz"), "/foo/bar/baz");
        assertEquals(ZKPaths.makePath("/foo/", "/bar/", "/baz/"), "/foo/bar/baz");
        assertEquals(ZKPaths.makePath("foo", null, null), "/foo");
        assertEquals(ZKPaths.makePath("foo", "bar", null), "/foo/bar");
        assertEquals(ZKPaths.makePath("foo", null, "baz"), "/foo/baz");
    }