private UserAgentInformation getUserAgentInformation(Map<String, String> headers) {
if (headers != null && Stagemonitor.getConfiguration(WebPlugin.class).isParseUserAgent()) {
final String userAgentHeader = headers.get("user-agent");
if (userAgentHeader != null) {
ReadableUserAgent readableUserAgent = userAgentCache.get(userAgentHeader);
if (readableUserAgent == null) {
readableUserAgent = parser.parse(userAgentHeader);
userAgentCache.put(userAgentHeader, readableUserAgent);
}
return new UserAgentInformation(readableUserAgent);