### Question:
PingPacketData implements PacketData { public static PingPacketData readFrom(final RLPInput in) { in.enterList(); in.readBigIntegerScalar(); final Optional<Endpoint> from = Endpoint.maybeDecodeStandalone(in); final Endpoint to = Endpoint.decodeStandalone(in); final long expiration = in.readLongScalar(); in.leaveListLenient(); return new PingPacketData(from, to, expiration); } private  PingPacketData(
      final Optional<Endpoint> maybeFrom, final Endpoint to, final long expiration); static PingPacketData create(final Endpoint from, final Endpoint to); static PingPacketData readFrom(final RLPInput in); @Override void writeTo(final RLPOutput out); Optional<Endpoint> getFrom(); Endpoint getTo(); long getExpiration(); @Override String toString();  }### Answer:
@Test public void readFrom() { final int version = 4; final Endpoint from = new Endpoint("127.0.0.1", 30303, Optional.of(30303)); final Endpoint to = new Endpoint("127.0.0.2", 30303, Optional.empty()); final long time = System.currentTimeMillis(); final BytesValueRLPOutput out = new BytesValueRLPOutput(); out.startList(); out.writeIntScalar(version); from.encodeStandalone(out); to.encodeStandalone(out); out.writeLongScalar(time); out.endList(); final Bytes serialized = out.encoded(); final PingPacketData deserialized = PingPacketData.readFrom(RLP.input(serialized)); assertThat(deserialized.getFrom()).contains(from); assertThat(deserialized.getTo()).isEqualTo(to); assertThat(deserialized.getExpiration()).isEqualTo(time); }