DefaultJsonEnvelope implements JsonEnvelope { @Override public JsonNumber payloadAsJsonNumber() { return (JsonNumber) payload; } DefaultJsonEnvelope(final Metadata metadata, final JsonValue payload); @Override Metadata metadata(); @Override JsonValue payload(); @Override JsonObject payloadAsJsonObject(); @Override JsonArray payloadAsJsonArray(); @Override JsonNumber payloadAsJsonNumber(); @Override JsonString payloadAsJsonString(); @Override JsonObject asJsonObject(); @Override String toString(); @Override String toDebugStringPrettyPrint(); @Override String toObfuscatedDebugString();  }
@Test public void shouldReturnPayloadAsJsonNumber() { assertThat(envelopeFrom(metadata, payloadAsJsonNumber).payloadAsJsonNumber(), equalTo(payloadAsJsonNumber)); }