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 testBeamEncoderMappings() {
    BASIC_CASES.forEach(
        (coder, data) -> {
          Encoder<?> encoder = encoderFor(coder);
          serializeAndDeserialize(data.get(0), (Encoder) encoder);
          Dataset<?> dataset = createDataset(data, (Encoder) encoder);
          assertThat(dataset.collect(), equalTo(data.toArray()));
        });
  }