@Test
public void testSlowPeerInfoPBHelper() {

  // Test with a map that has a few slow peer entries.
  final SlowPeerReports slowPeers = SlowPeerReports.create(
      ImmutableMap.of("peer1", 0.0, "peer2", 1.0, "peer3", 2.0));
  SlowPeerReports slowPeersConverted1 = PBHelper.convertSlowPeerInfo(
      PBHelper.convertSlowPeerInfo(slowPeers));
  assertTrue(
      "Expected map:" + slowPeers + ", got map:" +
          slowPeersConverted1.getSlowPeers(),
      slowPeersConverted1.equals(slowPeers));
  // Test with an empty map.
  SlowPeerReports slowPeersConverted2 = PBHelper.convertSlowPeerInfo(
      PBHelper.convertSlowPeerInfo(SlowPeerReports.EMPTY_REPORT));
  assertTrue(
      "Expected empty map:" + ", got map:" + slowPeersConverted2,
      slowPeersConverted2.equals(SlowPeerReports.EMPTY_REPORT));
}