### Question:
Writables { public static <K, V> WritableTableType<K, V> tableOf( PType<K> key, PType<V> value) { if (key instanceof WritableTableType) { WritableTableType wtt = (WritableTableType) key; key = pairs(wtt.getKeyType(), wtt.getValueType()); } else if (!(key instanceof WritableType)) { throw new IllegalArgumentException("Key type must be of class WritableType"); } if (value instanceof WritableTableType) { WritableTableType wtt = (WritableTableType) value; value = pairs(wtt.getKeyType(), wtt.getValueType()); } else if (!(value instanceof WritableType)) { throw new IllegalArgumentException("Value type must be of class WritableType"); } return new WritableTableType((WritableType) key, (WritableType) value); } private  Writables(); static PType<T> getPrimitiveType(Class<T> clazz); static void register(Class<T> clazz, WritableType<T, ? extends Writable> ptype); static final WritableType<Void, NullWritable> nulls(); static final WritableType<String, Text> strings(); static final WritableType<Long, LongWritable> longs(); static final WritableType<Integer, IntWritable> ints(); static final WritableType<Float, FloatWritable> floats(); static final WritableType<Double, DoubleWritable> doubles(); static final WritableType<Boolean, BooleanWritable> booleans(); static final WritableType<ByteBuffer, BytesWritable> bytes(); static final WritableType<T, W> records(Class<T> clazz); static WritableType<W, W> writables(Class<W> clazz); static WritableTableType<K, V> tableOf(
      PType<K> key, PType<V> value); static WritableType<Pair<V1, V2>, TupleWritable> pairs(PType<V1> p1, PType<V2> p2); static WritableType<Tuple3<V1, V2, V3>, TupleWritable> triples(PType<V1> p1,
      PType<V2> p2, PType<V3> p3); static WritableType<Tuple4<V1, V2, V3, V4>, TupleWritable> quads(PType<V1> p1,
      PType<V2> p2, PType<V3> p3, PType<V4> p4); static WritableType<TupleN, TupleWritable> tuples(PType... ptypes); static PType<T> tuples(Class<T> clazz, PType... ptypes); static PType<T> derived(Class<T> clazz, MapFn<S, T> inputFn, MapFn<T, S> outputFn,
      PType<S> base); static WritableType<Collection<T>, GenericArrayWritable<T>> collections(PType<T> ptype); static WritableType<Map<String, T>, MapWritable> maps(PType<T> ptype); static PType<T> jsons(Class<T> clazz); static T deepCopy(T value, Class<T> writableClass);  }### Answer:
@Test public void testTableOf() throws Exception { Pair<String, String> j = Pair.of("a", "b"); Pair<Text, Text> w = Pair.of(new Text("a"), new Text("b")); WritableTableType<String, String> wtt = Writables.tableOf(Writables.strings(), Writables.strings()); testInputOutputFn(wtt, j, w); }