### Question:
ComparableObjectSeries extends Series implements Cloneable, Serializable { protected void add(Comparable x, Object y) { add(x, y, true); } ComparableObjectSeries(Comparable key);  ComparableObjectSeries(Comparable key, boolean autoSort,
            boolean allowDuplicateXValues); boolean getAutoSort(); boolean getAllowDuplicateXValues(); @Override int getItemCount(); int getMaximumItemCount(); void setMaximumItemCount(int maximum); int indexOf(Comparable x); void clear(); ComparableObjectItem remove(Comparable x); @Override boolean equals(Object obj); @Override int hashCode();  }### Answer:
@Test public void testCloning() throws CloneNotSupportedException { MyComparableObjectSeries s1 = new MyComparableObjectSeries("A"); s1.add(new Integer(1), "ABC"); MyComparableObjectSeries s2 = (MyComparableObjectSeries) s1.clone(); assertNotSame(s1, s2); assertSame(s1.getClass(), s2.getClass()); assertEquals(s1, s2); }
@Test public void testSerialization() throws IOException, ClassNotFoundException { MyComparableObjectSeries s1 = new MyComparableObjectSeries("A"); s1.add(new Integer(1), "ABC"); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(s1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray())); MyComparableObjectSeries s2 = (MyComparableObjectSeries) in.readObject(); in.close(); assertEquals(s1, s2); }