@Test public void testGetStatsForTransport() { mTransportStats.registerConnectionTime(mTransportComponent1, 10L); mTransportStats.registerConnectionTime(mTransportComponent2, 20L); Stats stats = mTransportStats.getStatsForTransport(mTransportComponent1); assertThat(stats.average).isWithin(TOLERANCE).of(10); assertThat(stats.max).isEqualTo(10L); assertThat(stats.min).isEqualTo(10L); assertThat(stats.n).isEqualTo(1); }
@Nullable public Stats getStatsForTransport(ComponentName transportComponent) { synchronized (mStatsLock) { Stats stats = mTransportStats.get(transportComponent); if (stats == null) { return null; } return new Stats(stats); } }
TransportStats { @Nullable public Stats getStatsForTransport(ComponentName transportComponent) { synchronized (mStatsLock) { Stats stats = mTransportStats.get(transportComponent); if (stats == null) { return null; } return new Stats(stats); } } }
TransportStats { @Nullable public Stats getStatsForTransport(ComponentName transportComponent) { synchronized (mStatsLock) { Stats stats = mTransportStats.get(transportComponent); if (stats == null) { return null; } return new Stats(stats); } }  }
TransportStats { @Nullable public Stats getStatsForTransport(ComponentName transportComponent) { synchronized (mStatsLock) { Stats stats = mTransportStats.get(transportComponent); if (stats == null) { return null; } return new Stats(stats); } }  @Nullable Stats getStatsForTransport(ComponentName transportComponent); void dump(PrintWriter pw); }
TransportStats { @Nullable public Stats getStatsForTransport(ComponentName transportComponent) { synchronized (mStatsLock) { Stats stats = mTransportStats.get(transportComponent); if (stats == null) { return null; } return new Stats(stats); } }  @Nullable Stats getStatsForTransport(ComponentName transportComponent); void dump(PrintWriter pw);  }