EditableText { public TextChange insert(String toInsert, int position) { TextChange change = insertion(version, toInsert, position); this.apply(change); return change; } EditableText(String s); TextChange insert(String toInsert, int position); String getText(); void apply(TextChange textChange); int getVersion(); TextChange delete(int start, int end);  }
@Test public void insert() { TextChange change = text.insert("edited ", 12); assertThat(change.getVersion(), is(0)); assertThat(text.getText(), is("This is the edited baseline.")); assertThat(text.getVersion(), is(1)); }