private static String prepareUserHomeRelativePath(String userHomePath) {
        if (!(isUserHomeRelativePath(userHomePath))) {
            return userHomePath;
        }

        // Handle ~user and ~/path and ~

        // '~'
        if (userHomePath.equals(TILDE)) {
            return "";
        }

        // '~/'
        if (userHomePath.startsWith(TILDE + RUNTIME_SEP)) {
            return userHomePath.substring(2);
        }

        // '~user' is not supported; no logic to support "find the home directory for an arbitrary user".
        // e.g. '~user' or '~user/foo'
        throw new IllegalArgumentException("'" + userHomePath + "' cannot be relativized, cannot resolve arbitrary" +
                " user home paths.");
    }
Returns true if the supplied path begins with {@code ~}.  This means that the path should be resolved relative
to the user's home directory.

@param candidatePath the candidate path that may represent a path under the user's home directory
@return true if the path begins with {@code ~}
src/main/java/io/fabric8/maven/docker/util/VolumeBindingUtil.java