TupleSlot { public static TupleSlot of(String name, Type type) { if (name == null) throw new IllegalArgumentException("name must not be null"); if (type == null) throw new IllegalArgumentException("type must not be null"); return new TupleSlot(name, type); } private  TupleSlot(String name, Type type); static TupleSlot ofList(String name, Class<T> elementType); static TupleSlot ofOptional(String name, Class<T> valueType); static TupleSlot ofMap(String name, Class<K> keyType, Class<V> valueType); static TupleSlot of(String name, Type type); String getName(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void equality() { TupleSlot slot = TupleSlot.of("name", String.class); TupleSlot same = TupleSlot.of("name", String.class); TupleSlot differentName = TupleSlot.of("mane", String.class); TupleSlot differentType = TupleSlot.of("name", Integer.class); assertThat(slot, equalTo(same)); assertThat(slot, not(equalTo(differentName))); assertThat(slot, not(equalTo(differentType))); }