Record implements Iterable<Comparable<?>>, Serializable { public int size() { return values.length; } Record(List<? extends Comparable<?>> values);  Record(Comparable<?>... values); T get(int index); int size(); @Override Iterator<Comparable<?>> iterator(); boolean isNumeric(int index); @Override boolean equals(Object obj); @Override String toString(); Record insert(Comparable<?> value, int position);  }
@Test public void testSizeReturnsNumberOfElements() { Record record = new Record(null, null, null); assertThat(record.size(), is(3)); }
@Test public void testIsSerializable() throws IOException { Record record = new Record(-3.0, 1, "SomeString", null); ByteArrayOutputStream out = new ByteArrayOutputStream(); try (ObjectOutputStream oos = new ObjectOutputStream(out)) { oos.writeObject(record); } catch (NotSerializableException e) { fail("Unable to serialize " + Record.class.getName()); } assertTrue(out.size() > 0); }