@Test
public void testSubList() throws Exception {

    String text = "This is a simple text that I'm making up just for fun... or well for the sake of the test!";
    List<LayoutToken> layoutTokens = GrobidAnalyzer.getInstance().tokenizeWithLayoutToken(text);
    layoutTokens.stream().forEach(layoutToken -> layoutToken.setOffset(layoutToken.getOffset() + 1000));
    List<LayoutToken> result = LayoutTokensUtil.subListByOffset(layoutTokens, 1005, 1008);
    assertThat(result, hasSize(2));
    assertThat(result.get(0).getText(), is("is"));
    assertThat(result.get(1).getText(), is(" "));
}