InstantAppUrlFinder { @NotNull public String getDefaultUrl() { ImmutableCollection<String> urls = getAllUrls(); if (!urls.isEmpty()) { return urls.iterator().next(); } return ""; } InstantAppUrlFinder(@NotNull Module module); @VisibleForTesting  InstantAppUrlFinder(@NotNull AttributesResolver resolver, @NotNull Collection<Element> activities); @NotNull ImmutableCollection<String> getAllUrls(); @NotNull String getDefaultUrl(); boolean matchesUrl(@NotNull String url);  }
@Test public void testGetDefaultUrl() throws Exception { InstantAppUrlFinder finder = new InstantAppUrlFinder(myResolver, createDummyValidData()); assertEquals("scheme1: }
@Test public void testGetDefaultUrlInvalidInput() throws Exception { InstantAppUrlFinder invalidFinder = new InstantAppUrlFinder(myResolver, ImmutableList.of((Element)createXMLContent("<intent-filter/>"))); assertEquals("", invalidFinder.getDefaultUrl()); }