DTOConverter { public static Digest toDigest(DigestDTO digestDTO) { if (digestDTO == null) { return null; } return new Digest(digestDTO.getAlgorithm(), digestDTO.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 toDigestTest() { DigestDTO digestDTO = new DigestDTO(DigestAlgorithm.SHA1, Utils.fromHex("22BDD97143DF6B39A65AFAD2AF6BD8BF20CD4F7B")); Digest digest = DTOConverter.toDigest(digestDTO); assertNotNull(digest); assertEquals(digest.getAlgorithm(), digestDTO.getAlgorithm()); assertTrue(Arrays.equals(digest.getValue(), digestDTO.getValue())); }