StringPropagationAdapter implements Propagation<K> { public static <K> Propagation<K> create(Propagation<String> delegate, KeyFactory<K> keyFactory) { if (delegate == null) throw new NullPointerException("delegate == null"); if (keyFactory == null) throw new NullPointerException("keyFactory == null"); if (keyFactory == KeyFactory.STRING) return (Propagation<K>) delegate; return new StringPropagationAdapter<>(delegate, keyFactory); } StringPropagationAdapter(Propagation<String> delegate, KeyFactory<K> keyFactory); static Propagation<K> create(Propagation<String> delegate, KeyFactory<K> keyFactory); @Override List<K> keys(); @Override Injector<R> injector(Setter<R, K> setter); @Override Extractor<R> extractor(Getter<R, K> getter); @Override int hashCode(); @Override String toString(); @Override boolean equals(Object obj);  }
@Test public void propagation_equalsHashCodeString() { assertDelegates( () -> mock(Propagation.class), p -> StringPropagationAdapter.create(p, keyFactory) ); }