Cookie implements Cloneable, Serializable { @Override public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse); } } Cookie(String name, String value); @Override Object clone(); String getComment(); String getDomain(); int getMaxAge(); String getName(); String getPath(); boolean getSecure(); String getValue(); int getVersion(); boolean isHttpOnly(); void setComment(String comment); void setDomain(String domain); void setHttpOnly(boolean httpOnly); void setMaxAge(int maxAge); void setPath(String path); void setSecure(boolean secure); void setValue(String value); void setVersion(int version);  }
@Test void testClone() { Cookie cookie = new Cookie("name", "value"); Cookie clone = (Cookie) cookie.clone(); assertEquals(cookie.getName(), clone.getName()); assertEquals(cookie.getValue(), clone.getValue()); }