### Question:
JacksonElement implements JsonElement { @Override public JsonElement get(final int index) { if (!_node.isArray()) { throw new IndexOutOfBoundsException(String.valueOf(index)); } final JsonNode node = _node.get(index); if (node == null) { throw new IndexOutOfBoundsException(String.valueOf(index)); } return new JacksonElement(_mapper, node); } JacksonElement(final ObjectMapper mapper, final JsonNode node); @Override boolean isArray(); @Override boolean isObject(); @Override boolean isValue(); @Override JsonElement get(final int index); @Override JsonElement get(final String name); @Override boolean getBoolean(final boolean defaultValue); @Override double getDouble(final double defaultValue); @Override int getInt(final int defaultValue); @Override long getLong(final long defaultValue); @Override String getString(final String defaultValue); @Override T unwrap(final Class<T> type); @Override int size(); @Override T toObject(final Class<T> type, final T defaultValue); @Override int hashCode(); @Override boolean equals(final Object other); @Override String toString();  }### Answer:
@Test(expected = IndexOutOfBoundsException.class) public void getWithInvalidIndexTest() { final JsonElement array = toElement("[1]"); array.get(-1); }
@Test(expected = IllegalArgumentException.class) public void getWithNullNameTest() { final JsonElement object = toElement("{\"A\":1}"); object.get(null); }