DmrModelList extends DmrModelValue implements ModelList { @Override public ModelValue get(int index) { int size = (isDefined()) ? value.asInt() : 0; if (size <= index) throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size); return asValue(value.get(index)); } DmrModelList(ModelNode value); @Override ModelValue get(int index); @Override T get(int index, Class<T> valueType); @Override Model add(); @Override ModelList add(String value); @Override ModelList add(int value); @Override ModelList add(long value); @Override ModelList add(double value); @Override ModelList add(BigInteger value); @Override ModelList add(BigDecimal value); @Override ModelList add(boolean value); @Override List<ModelValue> getValues(); @Override @SuppressWarnings("unchecked") List<T> getValues(Class<T> valueType); @Override Iterator<ModelValue> iterator(); @Override int size();  }
@Test(expected = IndexOutOfBoundsException.class) public void testGetIndex_OutOfBounds() { modelList().get(0); }