class UserAgentHandler {

		private static final Pattern TOOL_REGEX = Pattern.compile("([^\\/]*)\\/([^ ]*).*");

		private static final Pattern STS_REGEX = Pattern.compile("STS (.*)");

		private static final Pattern NETBEANS_REGEX = Pattern.compile("nb-springboot-plugin\\/(.*)");

		static Agent parse(String userAgent) {<FILL_FUNCTION_BODY>}

	}

			Matcher matcher = TOOL_REGEX.matcher(userAgent);
			if (matcher.matches()) {
				String name = matcher.group(1);
				for (AgentId id : AgentId.values()) {
					if (name.equals(id.name)) {
						String version = matcher.group(2);
						return new Agent(id, version);
					}
				}
			}
			matcher = STS_REGEX.matcher(userAgent);
			if (matcher.matches()) {
				return new Agent(AgentId.STS, matcher.group(1));
			}
			matcher = NETBEANS_REGEX.matcher(userAgent);
			if (matcher.matches()) {
				return new Agent(AgentId.NETBEANS, matcher.group(1));
			}

			if (userAgent.equals(AgentId.INTELLIJ_IDEA.name)) {
				return new Agent(AgentId.INTELLIJ_IDEA, null);
			}
			if (userAgent.contains("Mozilla/5.0")) { // Super heuristics
				return new Agent(AgentId.BROWSER, null);
			}
			return null;
		
<no_super_class>