class FilesystemFacadeImpl implements IFilesystemFacade {

    @Override
    public IPath joinPaths(final IPath first, final IPath... rest) throws InvalidArgumentException {
        if (first == null || Arrays.asList(rest).indexOf(null) >= 0) {
            throw new InvalidArgumentException("One of arguments is null.");
        }

        java.nio.file.Path path = Paths.get(first.getPath());

        for (IPath p : rest) {
            path = path.resolve(p.getPath());
        }

        return new Path(path.toString());
    }

}