HashTypeAdaptor extends XmlAdapter<String, HashType> { @Override public String marshal(HashType hashType) throws Exception { return hashType.toString().toLowerCase(); }  @Override HashType unmarshal(String str); @Override String marshal(HashType hashType);  }
@Test public void returnsALowerCaseStringWhenMarshalling() throws Exception { HashTypeAdaptor hashTypeAdaptor = new HashTypeAdaptor(); assertThat(hashTypeAdaptor.marshal(HashType.MD5), is(equalTo("md5"))); }