DecompoundedWord implements Comparable<DecompoundedWord> { @Override public String toString() { StringBuilder s = new StringBuilder(); for (int i = 0; i < splits.size(); i++) { s.append(splits.get(i).toString()); if (i < splits.size() - 1) { s.append('+'); } } return s.toString(); }  static DecompoundedWord createFromString(String aSplit); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); void appendSplitElement(Fragment aSplit); void prependSplitElement(Fragment aSplit); List<Fragment> getSplits(); void setSplits(List<Fragment> aSplits); void addAll(List<Fragment> aSplits); void replaceSplitElement(int aIndex, DecompoundedWord aSplit); void replaceSplitElement(int aIndex, Fragment aSplitElement); boolean equalWithoutMorpheme(DecompoundedWord aOtherSplit); String getWord(); DecompoundedWord createCopy(); double getWeight(); void setWeight(double aWeight); @Override int compareTo(DecompoundedWord aOtherSplit); void setSplitPos(int aSplitPos); int getSplitPos(); boolean isCompound(); boolean hasLastFragmentMorpheme();  }
@Test public void testToString() { Fragment e1 = new Fragment(); e1.setWord("aktion"); e1.setMorpheme("s"); Fragment e2 = new Fragment(); e2.setWord("plan"); DecompoundedWord s = new DecompoundedWord(); s.appendSplitElement(e1); s.appendSplitElement(e2); assertEquals("aktion(s)+plan", s.toString()); }