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 testBeamEncoderOfPrivateType() {
    // Verify concrete types are not used in coder generation.
    // In case of private types this would cause an IllegalAccessError.
    List<PrivateString> data = asList(new PrivateString("1"), new PrivateString("2"));
    Dataset<PrivateString> dataset = createDataset(data, encoderFor(PrivateString.CODER));
    assertThat(dataset.collect(), equalTo(data.toArray()));
  }