Record implements Iterable<Comparable<?>>, Serializable { public <T extends Comparable<?>> T get(int index) { return (T) values[index]; } 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 testAllowsRetrievingValues() { Record record = new Record(-3.0, 1, "SomeString", null); assertThat(record.<Double>get(0), is(-3.0)); assertThat(record.<Integer>get(1), is(1)); assertThat(record.<String>get(2), is("SomeString")); assertThat(record.get(3), nullValue()); }