### Question:
PinnedPubKeyTrustManager implements X509TrustManager { public static SSLContext pinSha256SSLContext(final Stream<String> sha256Pins) { return sslContext(pinSha256TrustManager(sha256Pins)); } PinnedPubKeyTrustManager(final String algorithm, final Iterable<byte[]> pinnedPubKeys); static SSLContext sslContext(final TrustManager trustManager); static SSLContext pinSha256SSLContext(final Stream<String> sha256Pins); static SSLContext pinSha256SSLContext(final String... sha256Pins); static TrustManager pinSha256TrustManager(final Stream<String> sha256Pins); @Override void checkClientTrusted(final X509Certificate[] chain, final String authType); @Override void checkServerTrusted(final X509Certificate[] chain, final String authType); @Override X509Certificate[] getAcceptedIssuers(); String getAlgorithm(); Iterable<byte[]> getPinnedPubKeys();  }### Answer:
@Test public void pinSha256SSLContext() { assertEquals("pinnedpubkey authentication failed, server pin (SHA-256): t62CeU2tQiqkexU74Gxa2eg7fRbEgoChTociMee9wno=", testPin("moparisthebest.com", 443, "bla").getCause().getMessage()); assertEquals("pinnedpubkey authentication failed, server pin (SHA-256): t62CeU2tQiqkexU74Gxa2eg7fRbEgoChTociMee9wno=", testPin("moparisthebest.com", 443, "eEHQC9au2QRAP1FnvcYEsmvXT7511EXQ2gw8ppBfseM=").getCause().getMessage()); assertEquals("read: 1024", testPin("moparisthebest.com", 443, "t62CeU2tQiqkexU74Gxa2eg7fRbEgoChTociMee9wno=").getMessage()); }