class HttpMessageSupport {

    public static boolean keepAlive(HttpHeaders headers, HttpVersion version) {
        Optional<String> connection = headers.get(CONNECTION);

        if (connection.isPresent()) {
            if (CLOSE.toString().equalsIgnoreCase(connection.get())) {
                return false;
            }
            if (KEEP_ALIVE.toString().equalsIgnoreCase(connection.get())) {
                return true;
            }
        }
        return version.isKeepAliveDefault();
    }

    private  HttpMessageSupport();

}