### Question:
CacheEntry { final int getTotal() { return this.hits.get() + this.misses.get(); } CacheEntry(); final String getData(); final void setData(final String data); final int getHits(); final void incrementHits(); final int getMisses(); final void incrementMisses(); final boolean isExpired(final Date date); final void setExpiresIn(final int expiresInSeconds); final float getHitRate(); final float getMissRate();  }### Answer:
@Test public void testGetTotal() throws Exception { CacheEntry cacheEntry = new CacheEntry(); final int hits = 7; final int misses = 3; for(int i = 0; i < hits; i++) { cacheEntry.incrementHits(); } for(int i = 0; i < misses; i++) { cacheEntry.incrementMisses(); } final int expResult = hits + misses; final int result = cacheEntry.getTotal(); assertEquals(expResult, result); }