@Test
public void testGenerator() {

    docGenerator.generateDoc(pluginDocTree);
    ArgumentCaptor<String> pluginNameCaptor = ArgumentCaptor.forClass(String.class);
    ArgumentCaptor<String> docCaptor = ArgumentCaptor.forClass(String.class);
    verify(writerMock).writeDocFile(pluginNameCaptor.capture(), docCaptor.capture());
    assertThat(pluginNameCaptor.getValue(), is("plugin1"));
    assertThat(docCaptor.getValue().length(), greaterThan(180));
    assertThat(docCaptor.getValue().length(), lessThan(300)); // cheap test that command 3 is not duplicated.
    assertThat(docCaptor.getValue().contains("\n==== cmd1"), is(true));
    assertThat(docCaptor.getValue().contains("\n[cols=\"1a,5a\"]"), is(true));
    assertThat(docCaptor.getValue().contains("This is Result 3"), is(true));
}