Fragment { public static Fragment createFromString(String aElement) { Fragment e = new Fragment(); String[] splits = aElement.split("\\("); e.setWord(splits.length != 0 ? splits[0] : aElement); if ((splits.length == 2) && splits[1].endsWith(")")) { e.setMorpheme(splits[1].substring(0, splits[1].length() - 1)); } return e; } Fragment();  Fragment(String aWord);  Fragment(String aWord, String aMorpheme); static Fragment createFromString(String aElement); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); String getWord(); String getWordWithMorpheme(); void setWord(String aWord); String getMorpheme(); boolean hasMorpheme(); void setMorpheme(String aMorpheme); String toStringWithoutMorpheme(); boolean shouldSplitAgain(); void setSplitAgain(boolean aSplitAgain);  }
@Test public void testCreateFromString() { Fragment fragm = Fragment.createFromString("("); assertThat(fragm.getWord()).isEqualTo("("); }