TweetRepository { void updateCache(final Tweet tweet) { tweetCache.put(tweet.id, tweet); } TweetRepository(Handler mainHandler, SessionManager<TwitterSession> userSessionManagers);   TweetRepository(Handler mainHandler, SessionManager<TwitterSession> userSessionManagers,
            TwitterCore twitterCore);   }
@Test public void testSingleTweetCallback_callsUpdateCache() { final TweetRepository mockRepo = mock(TweetRepository.class); final TweetRepository.SingleTweetCallback callback = mockRepo.new SingleTweetCallback(null); callback.success(new Result<>(mock(Tweet.class), null)); verify(mockRepo, times(1)).updateCache(any(Tweet.class)); }