@Test public void testSplit() { replay(elementMock); expect(renderFontMock.getWidth("abc")).andReturn(95); expect(renderFontMock.getWidth("def")).andReturn(95); expect(renderFontMock.getWidth(" def")).andReturn(95); replay(renderFontMock); TextBreak textBreak = new TextBreak("abc def", 100, renderFontMock); List<String> lines = textBreak.split(); assertEquals(2, lines.size()); assertEquals("abc", lines.get(0)); assertEquals("def", lines.get(1)); }
@Nonnull public List<String> split() { if (isSingleLine()) { return singleResult(); } return processWords(); }
TextBreak { @Nonnull public List<String> split() { if (isSingleLine()) { return singleResult(); } return processWords(); } }
TextBreak { @Nonnull public List<String> split() { if (isSingleLine()) { return singleResult(); } return processWords(); } TextBreak(@Nonnull final String line, final int width, final RenderFont font); }
TextBreak { @Nonnull public List<String> split() { if (isSingleLine()) { return singleResult(); } return processWords(); } TextBreak(@Nonnull final String line, final int width, final RenderFont font); @Nonnull List<String> split(); }
TextBreak { @Nonnull public List<String> split() { if (isSingleLine()) { return singleResult(); } return processWords(); } TextBreak(@Nonnull final String line, final int width, final RenderFont font); @Nonnull List<String> split();  }