Tuple { public Map<String, Object> toMap() { return schema.toMap(values); } Tuple(TupleSchema schema, Object[] values); Object get(String name); T get(TupleKey<T> key); Map<String, V> serialise(Function<Object, V> serialiser); Map<String, Object> toMap(); TupleSchema getSchema(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void toMap() { final Tuple address = addressSchema.makeWith(asList("23 Acacia Avenue", "Sunderland"), "VB6 5UX"); Tuple person = personSchema.makeWith("Dominic", 41, address); assertThat(person.toMap(), equalTo(ImmutableMap.of( "name", "Dominic", "age", 41, "address", address))); }