public static <T> Encoder<T> encoderFor(Coder<T> coder) {
    Encoder<T> enc = getOrCreateDefaultEncoder(coder.getEncodedTypeDescriptor().getRawType());
    return enc != null ? enc : binaryEncoder(coder, true);
  }
@Test
  public void testBeamBinaryEncoder() {
    List<List<String>> data = asList(asList("a1", "a2", "a3"), asList("b1", "b2"), asList("c1"));

    Encoder<List<String>> encoder = encoderFor(ListCoder.of(StringUtf8Coder.of()));
    serializeAndDeserialize(data.get(0), encoder);

    Dataset<List<String>> dataset = createDataset(data, encoder);
    assertThat(dataset.collect(), equalTo(data.toArray()));
  }