### Question:
CtsPersistenceOperationsMonitor { public Long getTotalCount() throws CoreTokenException { return (long) delegate.countAllTokens(); } @Inject  CtsPersistenceOperationsMonitor(CtsPersistenceOperationsDelegate delegate); Long getTotalCount(); Long getTotalCount(TokenType tokenType); Long getAverageDuration(TokenType tokenType);  }### Answer:
@Test public void getTotalCountTest() throws CoreTokenException { int count = 1; given(delegate.countTokenEntries(any(TokenType.class))).willReturn(count); final long result = opsMonitor.getTotalCount(TokenType.SESSION); assertThat(result).isEqualTo(count); }
@Test(expectedExceptions = NullPointerException.class) public void getTotalCountTestErrorInvalidToken() throws CoreTokenException { final TokenType tokenType = null; opsMonitor.getTotalCount(tokenType); }