TupleSchema { public <V> Tuple deserialise(BiFunction<V, Type, Object> deserialiser, Map<String, V> values) { if (deserialiser == null) throw new IllegalArgumentException("deserialiser must not be null"); if (values == null) throw new IllegalArgumentException("values must not be null"); checkMatchingKeys(values); Object[] valueArray = new Object[slots.length]; getIndices().forEach(i -> valueArray[i] = slots[i].deserialise(deserialiser, values)); return make(valueArray); } private  TupleSchema(String name, TupleSlot[] slots, Map<String, Integer> slotLookup); static TupleSchema of(String name, TupleSlot...slots); String getName(); Tuple makeWith(Object...values); Tuple make(Object[] values); Tuple make(TupleKeyValue...keyValues); Tuple make(NamedValue...builders); Tuple make(Map<String, Object> values); Tuple deserialise(BiFunction<V, Type, Object> deserialiser, Map<String, V> values); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); TupleKey<Optional<T>> getOptionalKey(String name, Class<T> valueType); TupleKey<List<T>> getListKey(String name, Class<T> elementType); TupleKey<Map<K, V>> getMapKey(String name, Class<K> keyType, Class<V> valueType); TupleKey<T> getKey(String name, Type type);  }
@Test public void deserialise() { BiFunction<String, Type, Object> deserialiser = (s, t) -> Integer.parseInt(s); assertThat(coordinateSchema.deserialise(deserialiser, ImmutableMap.of( "y", "34", "x", "12")), equalTo(coordinateSchema.makeWith(12, 34))); }