BrowserSupport implements ViewConstants { public static boolean isBrowserSupported(String userAgentString) { UserAgent ua = UserAgent.parseUserAgentString(userAgentString); OperatingSystem osGroup = ua.getOperatingSystem().getGroup(); Browser browser = ua.getBrowser(); Set<Browser> supportedBrowsers = SUPPORTED.get(osGroup); return (supportedBrowsers != null) && supportedBrowsers.contains(browser.getGroup()) && !UNSUPPORTED.contains(browser); }  static boolean isBrowserSupported(String userAgentString); static final Map<OperatingSystem, Set<Browser>> SUPPORTED; static final Set<Browser> UNSUPPORTED; }
@Test(dataProvider="testBrowserSupportData") public void testBrowserSupport(String userAgentString, boolean supported) { Assert.assertEquals(BrowserSupport.isBrowserSupported(userAgentString), supported); }