### Question:
ExchangeOptions { public ExchangeOptions() { } ExchangeOptions();  ExchangeOptions(ExchangeOptions other);  ExchangeOptions(JsonObject json); List<String> getTo(); ExchangeOptions setTo(List<String> to); String getFrom(); ExchangeOptions setFrom(String from); String getControlChannel(); ExchangeOptions setControlChannel(String controlChannel); JsonObject toJson(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static final List<String> DEFAULT_TO; static final String DEFAULT_FROM; static final String DEFAULT_CONTROL_CHANNEL; }### Answer:
@Test @DisplayName("Validate log processor options") void testExchangeOptions() { new ExchangeOptionsConverter(); String badStr = "{\"from\": 10, \"to\": 20, \"controlChannel\": false}"; String optStr = "{\"from\":\"foo\", \"to\":[\"address1\",\"address2\"], \"controlChannel\":\"custom-channel\"}"; ExchangeOptions optNull = new ExchangeOptions() .setFrom(null) .setTo(emptyList()) .setControlChannel(null); ExchangeOptions optObj = new ExchangeOptions() .setFrom("foo") .setTo(asList("address1", "address2")) .setControlChannel("custom-channel"); JsonObject optJson = new JsonObject(optStr); assertThat(new ExchangeOptions(new JsonObject(badStr))).isEqualTo(new ExchangeOptions()); assertThat(optNull.toJson()).isEqualTo(obj().put("to", arr())); assertThat(optObj).isEqualTo(optObj); assertThat(optObj).isNotEqualTo(optNull); assertThat(optObj).isEqualTo(new ExchangeOptions(optJson)); assertThat(optObj).isEqualTo(new ExchangeOptions(optObj)); assertThat(optObj.toString()).isEqualTo(new ExchangeOptions(optJson).toString()); assertThat(optObj.hashCode()).isEqualTo(new ExchangeOptions(optJson).hashCode()); assertThat(optObj).isNotEqualTo(null); assertThat(optObj).isNotEqualTo(new Object()); assertThat(optObj.toJson()).isEqualTo(optJson); }