Program: 82463
Project: 82463
Buggy source:
/** 
 * Test that removing cookies with a path works correctly. Note that we do not verify failure to remove a cookie set with a path but removed without one as browser behavior differs.
 */
public void testRemoveCookiePath(){
  clearCookies();
  Cookies.setUriEncode(false);
  Cookies.setCookie("String_Node_Str","String_Node_Str",null,null,"String_Node_Str",false);
  Cookies.setCookie("String_Node_Str","String_Node_Str",null,null,"String_Node_Str",false);
  Cookies.setCookie("String_Node_Str","String_Node_Str",null,null,"String_Node_Str",false);
  Collection<String> cookies=Cookies.getCookieNames();
  assertEquals(3,cookies.size());
  Cookies.removeCookie("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",Cookies.getCookie("String_Node_Str"));
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals("String_Node_Str",Cookies.getCookie("String_Node_Str"));
  Cookies.removeCookie("String_Node_Str","String_Node_Str");
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals("String_Node_Str",Cookies.getCookie("String_Node_Str"));
  Cookies.removeCookie("String_Node_Str","String_Node_Str");
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  cookies=Cookies.getCookieNames();
  assertEquals(0,cookies.size());
  clearCookies();
  Cookies.setUriEncode(true);
  Cookies.setCookie("String_Node_Str","String_Node_Str",null,null,"String_Node_Str",false);
  Cookies.setCookie("String_Node_Str","String_Node_Str",null,null,"String_Node_Str",false);
  Cookies.setCookie("String_Node_Str","String_Node_Str",null,null,"String_Node_Str",false);
  cookies=Cookies.getCookieNames();
  assertEquals(3,cookies.size());
  Cookies.removeCookie("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",Cookies.getCookie("String_Node_Str"));
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals("String_Node_Str",Cookies.getCookie("String_Node_Str"));
  Cookies.removeCookie("String_Node_Str","String_Node_Str");
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals("String_Node_Str",Cookies.getCookie("String_Node_Str"));
  Cookies.removeCookie("String_Node_Str","String_Node_Str");
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  cookies=Cookies.getCookieNames();
  assertEquals(0,cookies.size());
}

Fixed version (ground truth):
/** 
 * Test that removing cookies with a path works correctly. Note that we do not verify failure to remove a cookie set with a path but removed without one as browser behavior differs.
 */
public void testRemoveCookiePath(){
  clearCookies();
  Cookies.setUriEncode(false);
  int curCount=Cookies.getCookieNames().size();
  Cookies.setCookie("String_Node_Str","String_Node_Str",null,null,"String_Node_Str",false);
  Cookies.setCookie("String_Node_Str","String_Node_Str",null,null,"String_Node_Str",false);
  Cookies.setCookie("String_Node_Str","String_Node_Str",null,null,"String_Node_Str",false);
  Collection<String> cookies=Cookies.getCookieNames();
  assertEquals(curCount + 3,cookies.size());
  Cookies.removeCookie("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",Cookies.getCookie("String_Node_Str"));
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals("String_Node_Str",Cookies.getCookie("String_Node_Str"));
  Cookies.removeCookie("String_Node_Str","String_Node_Str");
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals("String_Node_Str",Cookies.getCookie("String_Node_Str"));
  Cookies.removeCookie("String_Node_Str","String_Node_Str");
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  cookies=Cookies.getCookieNames();
  assertEquals(curCount,cookies.size());
  clearCookies();
  Cookies.setUriEncode(true);
  Cookies.setCookie("String_Node_Str","String_Node_Str",null,null,"String_Node_Str",false);
  Cookies.setCookie("String_Node_Str","String_Node_Str",null,null,"String_Node_Str",false);
  Cookies.setCookie("String_Node_Str","String_Node_Str",null,null,"String_Node_Str",false);
  cookies=Cookies.getCookieNames();
  assertEquals(curCount + 3,cookies.size());
  Cookies.removeCookie("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",Cookies.getCookie("String_Node_Str"));
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals("String_Node_Str",Cookies.getCookie("String_Node_Str"));
  Cookies.removeCookie("String_Node_Str","String_Node_Str");
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals("String_Node_Str",Cookies.getCookie("String_Node_Str"));
  Cookies.removeCookie("String_Node_Str","String_Node_Str");
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  assertEquals(null,Cookies.getCookie("String_Node_Str"));
  cookies=Cookies.getCookieNames();
  assertEquals(curCount,cookies.size());
}