### Question:
HeartbeatInfoCache implements HeartbeatContributor, Serializable { public int size() { return infoCache.size(); }  void update(HeartbeatInfo info); void contributeToHttpCall(HeartbeatCall call); int size();  }### Answer:
@Test void size_heartbeatInfoCacheIsEmpty_zero() { infoCache.clear(); int result = heartbeatInfoCache.size(); assertEquals(0, result); }
@Test void size_heartbeatInfoIsCached_one() { infoCache.put(heartbeatInfo, heartbeatInfo); int result = heartbeatInfoCache.size(); assertEquals(1, result); }