private void addOptimisation() {
        if (runCmds != null && !runCmds.isEmpty() && shouldOptimise) {
            String optimisedRunCmd = StringUtils.join(runCmds.iterator(), " && ");
            runCmds.clear();
            runCmds.add(optimisedRunCmd);
        }
    }
Escape any slashes, quotes, and newlines int the value.  If any escaping occurred, quote the value.
@param key The key
@param value The value
@return Escaped and quoted key="value"
src/main/java/io/fabric8/maven/docker/assembly/DockerFileBuilder.java