DTOConverter { public static SignatureValueDTO toSignatureValueDTO(SignatureValue signatureValue) { if (signatureValue != null) { return new SignatureValueDTO(signatureValue.getAlgorithm(), signatureValue.getValue()); } return null; }  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 toSignatureValueDTOTest() { SignatureValue signatureValue = new SignatureValue(SignatureAlgorithm.DSA_SHA224, Utils.fromBase64("7b907e3ef6f8a4342ba42f9c66518bf32f0ec242e8784284c1d8cd816cd77bf2")); SignatureValueDTO signatureValueDTO = DTOConverter.toSignatureValueDTO(signatureValue); assertEquals(signatureValueDTO.getAlgorithm(), signatureValue.getAlgorithm()); assertTrue(Arrays.equals(signatureValueDTO.getValue(), signatureValue.getValue())); assertEquals(signatureValueDTO.hashCode(), signatureValue.hashCode()); }