public synchronized void clear() {
    map.clear();
    db.clear();
  }
@Test
  public void testClear() {
    Context app = RuntimeEnvironment.application;

    HttpUrl url = HttpUrl.parse("http://www.ehviewer.com/");
    Cookie cookie = new Cookie.Builder()
        .name("user")
        .value("1234567890")
        .domain("ehviewer.com")
        .path("/")
        .expiresAt(System.currentTimeMillis() + 3000)
        .build();

    CookieRepository repository = new CookieRepository(app, "cookie.db");
    repository.saveFromResponse(url, Collections.singletonList(cookie));
    Map<String, CookieSet> map = Reflect.on(repository).field("map").get();
    assertEquals(1, map.size());
    equals(map.get("ehviewer.com"), Collections.singletonList(cookie));
    repository.clear();
    map = Reflect.on(repository).field("map").get();
    assertEquals(0, map.size());
    repository.close();

    repository = new CookieRepository(app, "cookie.db");
    map = Reflect.on(repository).field("map").get();
    assertEquals(0, map.size());
    repository.close();
  }