### Question:
ReactCookieJarContainer implements CookieJarContainer { @Override public List<Cookie> loadForRequest(HttpUrl url) { if (cookieJar != null) { List<Cookie> cookies = cookieJar.loadForRequest(url); ArrayList<Cookie> validatedCookies = new ArrayList<>(); for (Cookie cookie : cookies) { try { Headers.Builder cookieChecker = new Headers.Builder(); cookieChecker.add(cookie.name(), cookie.value()); validatedCookies.add(cookie); } catch (IllegalArgumentException ignored) { } } return validatedCookies; } return Collections.emptyList(); }  @Override void setCookieJar(CookieJar cookieJar); @Override void removeCookieJar(); @Override void saveFromResponse(HttpUrl url, List<Cookie> cookies); @Override List<Cookie> loadForRequest(HttpUrl url);  }### Answer:
@Test public void testMissingJar() throws Exception { ReactCookieJarContainer jarContainer = mock(ReactCookieJarContainer.class); assertThat(jarContainer.loadForRequest(any(HttpUrl.class)).size()).isEqualTo(0); }
@Test public void testEmptyCookies() throws Exception { ReactCookieJarContainer jarContainer = mock(ReactCookieJarContainer.class); List<Cookie> cookies = new ArrayList<>(); when(jarContainer.loadForRequest(any(HttpUrl.class))).thenReturn(cookies); assertThat(jarContainer.loadForRequest(any(HttpUrl.class)).size()).isEqualTo(0); }