BlueUrlTokenizer { public static @CheckForNull BlueUrlTokenizer parse(@Nonnull String url) { Iterator<String> urlTokens = extractTokens(url); if (urlTokens.hasNext()) { if (urlTokens.next().equalsIgnoreCase("blue")) { BlueUrlTokenizer blueUrlTokenizer = new BlueUrlTokenizer(); if (urlTokens.hasNext()) { String next = urlTokens.next(); if (next.equalsIgnoreCase("pipelines")) { blueUrlTokenizer.addPart(UrlPart.DASHBOARD_PIPELINES, next); } else if (next.equalsIgnoreCase("organizations")) { if (urlTokens.hasNext()) { blueUrlTokenizer.addPart(UrlPart.ORGANIZATION, urlTokens.next()); if (urlTokens.hasNext()) { blueUrlTokenizer.addPart(UrlPart.PIPELINE, urlDecode(urlTokens.next())); if (urlTokens.hasNext()) { next = urlTokens.next(); if (next.equalsIgnoreCase("detail")) { blueUrlTokenizer.addPart(UrlPart.PIPELINE_RUN_DETAIL, next); if (urlTokens.hasNext()) { blueUrlTokenizer.addPart(UrlPart.BRANCH, urlDecode(urlTokens.next())); if (urlTokens.hasNext()) { blueUrlTokenizer.addPart(UrlPart.PIPELINE_RUN_DETAIL_ID, urlDecode(urlTokens.next())); if (urlTokens.hasNext()) { next = urlTokens.next(); if (PIPELINE_RUN_DETAIL_TABS.contains(next.toLowerCase())) { blueUrlTokenizer.addPart(UrlPart.PIPELINE_RUN_DETAIL_TAB, next.toLowerCase()); } } } } } else if (PIPELINE_TABS.contains(next.toLowerCase())) { blueUrlTokenizer.addPart(UrlPart.PIPELINE_TAB, next.toLowerCase()); } } } } } } return blueUrlTokenizer; } } return null; } private  BlueUrlTokenizer(); static @CheckForNull BlueUrlTokenizer parseCurrentRequest(); static @CheckForNull BlueUrlTokenizer parse(@Nonnull String url); boolean hasPart(@Nonnull UrlPart urlPart); @CheckForNull String getPart(@Nonnull UrlPart urlPart); @CheckForNull UrlPart getLastPart(); boolean lastPartIs(@Nonnull UrlPart urlPart); boolean lastPartIs(@Nonnull UrlPart urlPart, @Nonnull String value);  }
@Test public void test_MalformedURLException() { Assert.assertNull(BlueUrlTokenizer.parse("/a")); }