RemoteCertificateConverter { public static RemoteCertificate toRemoteCertificate(CertificateToken certificate) { if (certificate == null) { return null; } return new RemoteCertificate(certificate.getEncoded()); }  static CertificateToken toCertificateToken(RemoteCertificate remoteCertificate); static RemoteCertificate toRemoteCertificate(CertificateToken certificate); static List<CertificateToken> toCertificateTokens(List<RemoteCertificate> remoteCertificates);  }
@Test public void toRemoteCertificateTest() { CertificateToken certificateToken = DSSUtils.loadCertificate(encodedCertificate); RemoteCertificate remoteCertificate = RemoteCertificateConverter.toRemoteCertificate(certificateToken); assertTrue(Arrays.equals(remoteCertificate.getEncodedCertificate(), certificateToken.getEncoded())); }