StatusDetailMessage implements Jsonifiable<JsonObject> { public static StatusDetailMessage fromJson(final JsonObject jsonObject) { if (jsonObject.getSize() != 1) { throw new JsonParseException("Message must contain exactly one field, but does not:\n" + jsonObject); } final JsonField messageField = jsonObject.iterator().next(); final Level level = Level.valueOf(messageField.getKeyName()); final JsonValue message = messageField.getValue(); return of(level, message); } 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 fromValidJsonObject() { final StatusDetailMessage actual = StatusDetailMessage.fromJson(KNOWN_MESSAGE_JSON); assertThat(actual).isEqualTo(KNOWN_MESSAGE); }