@Test
public void buildsMarshallerWithJAXBEncodingProperty() throws Exception {

  JAXBContextFactory factory =
      new JAXBContextFactory.Builder().withMarshallerJAXBEncoding("UTF-16").build();
  Marshaller marshaller = factory.createMarshaller(Object.class);
  assertEquals("UTF-16", marshaller.getProperty(Marshaller.JAXB_ENCODING));
}