TransportSecurityOptions { public static TransportSecurityOptions fromJson(String json) { return new TransportSecurityOptionsJsonSerializer() .deserialize(new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_8))); } private  TransportSecurityOptions(Builder builder); Optional<Path> getPrivateKeyFile(); Optional<Path> getCertificatesFile(); Optional<Path> getCaCertificatesFile(); Optional<AuthorizedPeers> getAuthorizedPeers(); List<String> getAcceptedCiphers(); boolean isHostnameValidationDisabled(); static TransportSecurityOptions fromJsonFile(Path file); static TransportSecurityOptions fromJson(String json); String toJson(); void toJsonFile(Path file); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void can_read_options_from_json() throws IOException { String tlsJson = new String(Files.readAllBytes(TEST_CONFIG_FILE), StandardCharsets.UTF_8); TransportSecurityOptions actualOptions = TransportSecurityOptions.fromJson(tlsJson); assertEquals(OPTIONS, actualOptions); }