WordCountMP implements Cloneable { @Override public WordCountMP clone() throws CloneNotSupportedException { WordCountMP mp = (WordCountMP)super.clone(); return mp; }  @MessageHandler List<?> handleWord(Word word); @Override WordCountMP clone();  }
@Test public void cloneTest() throws CloneNotSupportedException { WordCountMP clone1 = mp.clone(); WordCountMP clone2 = mp.clone(); Assert.assertNotNull(clone1); Assert.assertNotNull(clone2); Assert.assertNull(clone1.word); Assert.assertNull(clone2.word); clone1.word = new Word("Test"); Assert.assertNotNull(clone1.word); Assert.assertNull(clone2.word); Assert.assertNotSame(clone2.word, clone1.word); }