@Test
public void testError() {

    StringListType type = new StringListType("foo=bar", "electric", "chair");
    try {
        // Index is between 0 and number of elements -1
        @SuppressWarnings("unused")
        String value = type.getValue(-1);
        fail("-1 is an invalid index");
    } catch (IllegalArgumentException e) {
        // That's what we expect.
    }
    try {
        @SuppressWarnings("unused")
        String value = type.getValue(3);
        fail("3 is an invalid index");
    } catch (IllegalArgumentException e) {
        // That's what we expect.
    }
}