SortedWrapper implements Wrapper<Element> { @Override public String toString() { return "SortedWrapper{" + "element=" + element + '}'; } SortedWrapper(final Element element, final int sortOrder); @Override Element getContent(); @Override boolean isBefore(final Wrapper<? extends Content> wrapper); @Override String toString();  }
@Test void toStringWithIndentShouldWork() { assertThat(new SortedWrapper(new Element("Gurka"), 123).toString(" "), is(" SortedWrapper{element=[Element: <Gurka/>]}")); assertThat(new SortedWrapper(null, 123).toString(" "), is(" SortedWrapper{element=null}")); }