Record implements Iterable<Comparable<?>>, Serializable { @Override public String toString() { StringBuilder representation = new StringBuilder("("); for (int elementIndex = 0; elementIndex < values.length; elementIndex++) { Comparable element = values[elementIndex]; representation.append(element); if (elementIndex != values.length - 1) { representation.append(", "); } } representation.append(")"); return representation.toString(); } 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 testToStringReturnsReadableTuple() { Record record = new Record(-3.0, 1, "SomeString", null); String string = record.toString(); assertThat(string, is("("+"-3.0, "+"1, "+"SomeString, "+"null"+")")); }