@Test
public void abbreviateMiddle() throws Exception {

    assertNull(Strings.abbreviateMiddle(null, 0));
    assertNull(Strings.abbreviateMiddle(null, 1));
    assertNull(Strings.abbreviateMiddle(null, 100));
    assertEquals("", Strings.abbreviateMiddle("", 0));
    assertEquals("", Strings.abbreviateMiddle("", 1));
    assertEquals("", Strings.abbreviateMiddle("", 100));
    assertEquals("", Strings.abbreviateMiddle("foo", 0));
    assertEquals("f", Strings.abbreviateMiddle("foo", 1));
    assertEquals("fo", Strings.abbreviateMiddle("foo", 2));
    assertEquals("foo", Strings.abbreviateMiddle("foo", 3));
    assertEquals("foo", Strings.abbreviateMiddle("foo", 4));
    assertEquals("foo", Strings.abbreviateMiddle("foo", 100));
    assertEquals("", Strings.abbreviateMiddle("foobar", 0));
    assertEquals("f", Strings.abbreviateMiddle("foobar", 1));
    assertEquals("fo", Strings.abbreviateMiddle("foobar", 2));
    assertEquals("foo", Strings.abbreviateMiddle("foobar", 3));
    assertEquals("f...", Strings.abbreviateMiddle("foobar", 4));
    assertEquals("f...r", Strings.abbreviateMiddle("foobar", 5));
    assertEquals("foobar", Strings.abbreviateMiddle("foobar", 6));
    assertEquals("foobar", Strings.abbreviateMiddle("foobar", 7));
    assertEquals("foobar", Strings.abbreviateMiddle("foobar", 100));
    assertEquals("", Strings.abbreviateMiddle("Lorem ipsum dolor sit amet", 0));
    assertEquals("L", Strings.abbreviateMiddle("Lorem ipsum dolor sit amet", 1));
    assertEquals("Lore...met", Strings.abbreviateMiddle("Lorem ipsum dolor sit amet", 10));
    assertEquals("Lorem ipsum dolor sit amet", Strings.abbreviateMiddle("Lorem ipsum dolor sit amet", 26));
    assertEquals("Lorem ipsum dolor sit amet", Strings.abbreviateMiddle("Lorem ipsum dolor sit amet", 100));
}