StatusDetailMessage implements Jsonifiable<JsonObject> { @Override public JsonObject toJson() { return JsonObject.newBuilder() .set(level.toString(), message) .build(); } private  StatusDetailMessage(final Level level, final JsonValue message); static StatusDetailMessage of(final Level level, final String message); static StatusDetailMessage of(final Level level, final JsonValue message); static StatusDetailMessage warn(@Nullable final Throwable throwable); @Override JsonObject toJson(); static StatusDetailMessage fromJson(final JsonObject jsonObject); Level getLevel(); JsonValue getMessage(); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override String toString();  }
@Test public void toJsonReturnsExpected() { final JsonObject actualJson = KNOWN_MESSAGE.toJson(); assertThat(actualJson).isEqualTo(KNOWN_MESSAGE_JSON); }