@Test
public void testGetSubString() {

  StringContainer a = new StringContainer();
  try {
    a.getSubString(0);
  } catch (Exception e) {
    assertTrue(e instanceof IndexOutOfBoundsException);
  }
  a.addHead("a", "bbb", "cc");
  assertEquals("a", a.getSubString(0));
  assertEquals("cc", a.getSubString(-1));
  assertEquals("bbb", a.getSubString(-2));
  try {
    a.getSubString(4);
  } catch (Exception e) {
    assertTrue(e instanceof IndexOutOfBoundsException);
  }
  a.addTail("dd", "eeee");
  assertEquals("a", a.getSubString(0));
  assertEquals("cc", a.getSubString(-3));
  assertEquals("dd", a.getSubString(3));
  assertEquals("eeee", a.getSubString(-1));
  try {
    a.getSubString(9);
  } catch (Exception e) {
    assertTrue(e instanceof IndexOutOfBoundsException);
  }
}