### Question:
MutableTomlArray implements TomlArray { MutableTomlArray append(Object value, TomlPosition position) { requireNonNull(value); if (value instanceof Integer) { value = ((Integer) value).longValue(); } TomlType origType = type; Optional<TomlType> valueType = typeFor(value); if (!valueType.isPresent()) { throw new IllegalArgumentException("Unsupported type " + value.getClass().getSimpleName()); } if (type != null) { if (valueType.get() != type) { throw new TomlInvalidTypeException( "Cannot add a " + typeNameFor(value) + " to an array containing " + type.typeName() + "s"); } } else { type = valueType.get(); } try { elements.add(new Element(value, position)); } catch (Throwable e) { type = origType; throw e; } return this; } MutableTomlArray();   MutableTomlArray(boolean definedAsLiteral); @Override int size(); @Override boolean isEmpty(); @Override boolean containsStrings(); @Override boolean containsLongs(); @Override boolean containsDoubles(); @Override boolean containsBooleans(); @Override boolean containsOffsetDateTimes(); @Override boolean containsLocalDateTimes(); @Override boolean containsLocalDates(); @Override boolean containsLocalTimes(); @Override boolean containsArrays(); @Override boolean containsTables(); @Override Object get(int index); @Override TomlPosition inputPositionOf(int index); @Override List<Object> toList();  }### Answer:
@Test void cannotAppendUnsupportedType() { MutableTomlArray array = new MutableTomlArray(); assertThrows(IllegalArgumentException.class, () -> array.append(this, positionAt(1, 1))); assertThrows(NullPointerException.class, () -> array.append(null, positionAt(1, 1))); }
@Test void shouldGetDouble() { MutableTomlArray array = new MutableTomlArray().append(23.5d, positionAt(1, 1)); assertEquals(23.5d, array.getDouble(0)); }
@Test void shouldGetLong() { MutableTomlArray array = new MutableTomlArray().append(23L, positionAt(1, 1)); assertEquals(23L, array.getLong(0)); }
@Test void shouldGetBoolean() { MutableTomlArray array = new MutableTomlArray().append(false, positionAt(1, 1)); assertEquals(false, array.getBoolean(0)); }
@Test void shouldGetOffSetDateTime() { OffsetDateTime time = OffsetDateTime.now(); MutableTomlArray array = new MutableTomlArray().append(time, positionAt(1, 1)); assertEquals(time, array.getOffsetDateTime(0)); }
@Test void shouldGetLocalDateTime() { LocalDateTime time = LocalDateTime.now(); MutableTomlArray array = new MutableTomlArray().append(time, positionAt(1, 1)); assertEquals(time, array.getLocalDateTime(0)); }
@Test void shouldGetLocalDate() { LocalDate time = LocalDate.now(); MutableTomlArray array = new MutableTomlArray().append(time, positionAt(1, 1)); assertEquals(time, array.getLocalDate(0)); }
@Test void shouldGetLocalTime() { LocalTime time = LocalTime.now(); MutableTomlArray array = new MutableTomlArray().append(time, positionAt(1, 1)); assertEquals(time, array.getLocalTime(0)); }
@Test void toJson() { MutableTomlArray array = new MutableTomlArray().append("foo", positionAt(1, 1)).append("bar", positionAt(10, 1)); assertEquals("[\n \"foo\",\n \"bar\"\n]\n", array.toJson()); }