DTOConverter { public static ToBeSignedDTO toToBeSignedDTO(ToBeSigned toBeSigned) { if (toBeSigned != null) { return new ToBeSignedDTO(toBeSigned.getBytes()); } 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 toToBeSignedDTOTest() { ToBeSigned toBeSigned = new ToBeSigned(new byte[] {'1','2','3'}); ToBeSignedDTO toBeSignedDTO = DTOConverter.toToBeSignedDTO(toBeSigned); assertTrue(Arrays.equals(toBeSignedDTO.getBytes(), toBeSigned.getBytes())); assertEquals(toBeSignedDTO.hashCode(), toBeSigned.hashCode()); }