TrailStatisticsImpl implements TrailStatistics { private void readObject(final ObjectInputStream stream) throws InvalidObjectException { throw new InvalidObjectException("Proxy required"); } TrailStatisticsImpl(
      final Statistics time,
      final Statistics dist,
      final Statistics ele,
      final Statistics eleDiff,
      final Statistics speed,
      final Statistics grade); @Override Statistics getTimeDifferenceSummary(); @Override Statistics getDistanceSummary(); @Override Statistics getElevationDifferenceSummary(); @Override Statistics getSpeedSummary(); @Override Statistics getGradeSummary(); @Override Statistics getElevationSummary(); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void serialize() throws IOException, ClassNotFoundException { final TrailStatistics stats = getStats(); final ByteArrayOutputStream out = new ByteArrayOutputStream(); final ObjectOutputStream oos = new ObjectOutputStream(out); oos.writeObject(stats); oos.close(); final byte[] recovered = out.toByteArray(); final InputStream in = new ByteArrayInputStream(recovered); final ObjectInputStream ois = new ObjectInputStream(in); final TrailStatistics recoveredStats = (TrailStatistics) ois.readObject(); assertEquals(stats, recoveredStats); }