@Test public void testParse() throws Exception { final List<String> source = Collections.singletonList("source"); final int currentIndex = 4783; final String smooshed = "smooshed text"; when(smoosher.smoosh(currentIndex + 1, source)).thenReturn(smooshed); final IncludeDocumentation doc = mock(IncludeDocumentation.class); whenNew(IncludeDocumentation.class).withArguments(smooshed).thenReturn(doc); assertThat(factory.parse(currentIndex, source)).isEqualTo(doc); }
@Override public IncludeDocumentation parse(final int currentIndex, final List<String> source) { return new IncludeDocumentation(smoosher.smoosh(currentIndex + 1, source)); }
IncludeDocumentationFactory implements TopLevelDocumentationFactory<IncludeDocumentation> { @Override public IncludeDocumentation parse(final int currentIndex, final List<String> source) { return new IncludeDocumentation(smoosher.smoosh(currentIndex + 1, source)); } }
IncludeDocumentationFactory implements TopLevelDocumentationFactory<IncludeDocumentation> { @Override public IncludeDocumentation parse(final int currentIndex, final List<String> source) { return new IncludeDocumentation(smoosher.smoosh(currentIndex + 1, source)); } IncludeDocumentationFactory();  IncludeDocumentationFactory(final DocumentationBlockIndexedSmoosher smoosher); }
IncludeDocumentationFactory implements TopLevelDocumentationFactory<IncludeDocumentation> { @Override public IncludeDocumentation parse(final int currentIndex, final List<String> source) { return new IncludeDocumentation(smoosher.smoosh(currentIndex + 1, source)); } IncludeDocumentationFactory();  IncludeDocumentationFactory(final DocumentationBlockIndexedSmoosher smoosher); @Override boolean canParse(final int currentIndex, final List<String> source); @Override int getEndingIndex(); @Override IncludeDocumentation parse(final int currentIndex, final List<String> source); }
IncludeDocumentationFactory implements TopLevelDocumentationFactory<IncludeDocumentation> { @Override public IncludeDocumentation parse(final int currentIndex, final List<String> source) { return new IncludeDocumentation(smoosher.smoosh(currentIndex + 1, source)); } IncludeDocumentationFactory();  IncludeDocumentationFactory(final DocumentationBlockIndexedSmoosher smoosher); @Override boolean canParse(final int currentIndex, final List<String> source); @Override int getEndingIndex(); @Override IncludeDocumentation parse(final int currentIndex, final List<String> source);  }