@Test public void testStoredCookieRefTagForProject() { final CookieManager cookieManager = new CookieManager(); final CookieStore cookieStore = cookieManager.getCookieStore(); final Project project = ProjectFactory.project(); final RefTag refTag = RefTag.recommended(); cookieStore.add(null, new HttpCookie("ref_" + project.id(), refTag.tag() + "%3F" + SystemUtils.secondsSinceEpoch())); final RefTag retrievedRefTag = RefTagUtils.storedCookieRefTagForProject(project, cookieManager, sharedPreferences); assertNotNull(retrievedRefTag); assertEquals(refTag, retrievedRefTag); }
public static @Nullable RefTag storedCookieRefTagForProject(final @NonNull Project project, final @NonNull CookieManager cookieManager, final @NonNull SharedPreferences sharedPreferences) { final HttpCookie cookie = findRefTagCookieForProject(project, cookieManager, sharedPreferences); if (cookie == null) { return null; } final String[] components = cookie.getValue() .split(COOKIE_VALUE_SEPARATOR); if (components.length > 0) { return RefTag.from(components[0]); } return null; }
RefTagUtils { public static @Nullable RefTag storedCookieRefTagForProject(final @NonNull Project project, final @NonNull CookieManager cookieManager, final @NonNull SharedPreferences sharedPreferences) { final HttpCookie cookie = findRefTagCookieForProject(project, cookieManager, sharedPreferences); if (cookie == null) { return null; } final String[] components = cookie.getValue() .split(COOKIE_VALUE_SEPARATOR); if (components.length > 0) { return RefTag.from(components[0]); } return null; } }
RefTagUtils { public static @Nullable RefTag storedCookieRefTagForProject(final @NonNull Project project, final @NonNull CookieManager cookieManager, final @NonNull SharedPreferences sharedPreferences) { final HttpCookie cookie = findRefTagCookieForProject(project, cookieManager, sharedPreferences); if (cookie == null) { return null; } final String[] components = cookie.getValue() .split(COOKIE_VALUE_SEPARATOR); if (components.length > 0) { return RefTag.from(components[0]); } return null; } private  RefTagUtils(); }
RefTagUtils { public static @Nullable RefTag storedCookieRefTagForProject(final @NonNull Project project, final @NonNull CookieManager cookieManager, final @NonNull SharedPreferences sharedPreferences) { final HttpCookie cookie = findRefTagCookieForProject(project, cookieManager, sharedPreferences); if (cookie == null) { return null; } final String[] components = cookie.getValue() .split(COOKIE_VALUE_SEPARATOR); if (components.length > 0) { return RefTag.from(components[0]); } return null; } private  RefTagUtils(); static @Nullable RefTag storedCookieRefTagForProject(final @NonNull Project project,
    final @NonNull CookieManager cookieManager, final @NonNull SharedPreferences sharedPreferences); static @Nullable HttpCookie buildCookieWithRefTagAndProject(final @NonNull RefTag refTag,
    final @NonNull Project project); static @NonNull Pair<Project, RefTag> projectAndRefTagFromParamsAndProject(final @NonNull DiscoveryParams params,
    final @NonNull Project project); static void storeCookie(final @NonNull RefTag refTag, final @NonNull Project project,
    final @NonNull CookieManager cookieManager, final @NonNull SharedPreferences sharedPreferences); }
RefTagUtils { public static @Nullable RefTag storedCookieRefTagForProject(final @NonNull Project project, final @NonNull CookieManager cookieManager, final @NonNull SharedPreferences sharedPreferences) { final HttpCookie cookie = findRefTagCookieForProject(project, cookieManager, sharedPreferences); if (cookie == null) { return null; } final String[] components = cookie.getValue() .split(COOKIE_VALUE_SEPARATOR); if (components.length > 0) { return RefTag.from(components[0]); } return null; } private  RefTagUtils(); static @Nullable RefTag storedCookieRefTagForProject(final @NonNull Project project,
    final @NonNull CookieManager cookieManager, final @NonNull SharedPreferences sharedPreferences); static @Nullable HttpCookie buildCookieWithRefTagAndProject(final @NonNull RefTag refTag,
    final @NonNull Project project); static @NonNull Pair<Project, RefTag> projectAndRefTagFromParamsAndProject(final @NonNull DiscoveryParams params,
    final @NonNull Project project); static void storeCookie(final @NonNull RefTag refTag, final @NonNull Project project,
    final @NonNull CookieManager cookieManager, final @NonNull SharedPreferences sharedPreferences);  }