DTOConverter { public static DigestDTO toDigestDTO(Digest digest) { if (digest == null) { return null; } return new DigestDTO(digest.getAlgorithm(), digest.getValue()); }  static ToBeSigned toToBeSigned(ToBeSignedDTO toBeSignedDTO); static ToBeSignedDTO toToBeSignedDTO(ToBeSigned toBeSigned); static SignatureValue toSignatureValue(SignatureValueDTO signatureValueDTO); static SignatureValueDTO toSignatureValueDTO(SignatureValue signatureValue); static Digest toDigest(DigestDTO digestDTO); static DigestDTO toDigestDTO(Digest digest);  }
@Test public void toDigestDTOTest() { Digest digest = new Digest(DigestAlgorithm.SHA1, Utils.fromHex("22BDD97143DF6B39A65AFAD2AF6BD8BF20CD4F7B")); DigestDTO digestDTO = DTOConverter.toDigestDTO(digest); assertNotNull(digestDTO); assertEquals(digest.getAlgorithm(), digestDTO.getAlgorithm()); assertTrue(Arrays.equals(digest.getValue(), digestDTO.getValue())); }