  @Test
  public void truncate() {

    // Tests the suite of truncate methods
    
    assertEquals("This", StringHelper.truncate(sentence, 4));
    assertEquals("Foo", StringHelper.truncate("Foo", 4));
    assertNull(StringHelper.truncate(null, 50));
    
    assertEquals("nce.", StringHelper.truncateAtEnd(sentence, 4));
    assertEquals("Foo", StringHelper.truncateAtEnd("Foo", 4));
    assertNull(StringHelper.truncateAtEnd(null, 50));
    
    assertEquals("This...", StringHelper.truncateEllipsis(sentence, 7, false, false, "..."));
    assertEquals("This...", StringHelper.truncateEllipsis(sentence, 8, true, true, "..."));
    assertEquals("This is...", StringHelper.truncateEllipsis(sentence, 8, true, false, "..."));
    assertEquals("", StringHelper.truncateEllipsis("", 100, true, true, "..."));
  }