@Test
public void testPrefix() {

    String word = "Grobid";
    assertEquals("", TextUtilities.prefix(word, 0));
    assertEquals("G", TextUtilities.prefix(word, 1));
    assertEquals("Gr", TextUtilities.prefix(word, 2));
    assertEquals("Gro", TextUtilities.prefix(word, 3));
    assertEquals("Grob", TextUtilities.prefix(word, 4));
    assertEquals("Grobid", TextUtilities.prefix(word, 6));
    assertEquals("Grobid", TextUtilities.prefix(word, 100));
    assertEquals(null, TextUtilities.prefix(null, 0));
    assertEquals(null, TextUtilities.prefix(null, 1));
}