@Test
public void resolveFontsWhenTextRepeats() {

    PDDocument doc = new PDDocument();
    List<TextWithFont> textAndFonts = FontUtils.resolveFonts("123α456α789", HELVETICA, doc);
    assertThat(textAndFonts.get(0).getFont().getName(), is("Helvetica"));
    assertThat(textAndFonts.get(0).getText(), is("123"));
    assertThat(textAndFonts.get(1).getFont().getName(), is(not("Helvetica")));
    assertThat(textAndFonts.get(1).getText(), is("α"));
    assertThat(textAndFonts.get(2).getFont().getName(), is("Helvetica"));
    assertThat(textAndFonts.get(2).getText(), is("456"));
    assertThat(textAndFonts.get(3).getFont().getName(), is(not("Helvetica")));
    assertThat(textAndFonts.get(3).getText(), is("α"));
}