@Test
public void testCalculateLagTime() {

  EasyMock.expect(workloadInfoRetriever.topicWorkload(fakeTopics.get(0))).andReturn(fakeWorkload1).times(3);
  EasyMock.expect(workloadInfoRetriever.topicWorkload(fakeTopics.get(1))).andReturn(fakeWorkload2).times(2);
  EasyMock.expect(workloadInfoRetriever.isInitialized()).andReturn(true).anyTimes();
  EasyMock.expect(offsetMonitor.getTopicPartitionOffset(fakeTopicPartition1)).andReturn(
      new TopicPartitionLag(fakeTopicPartition1.getTopic(), fakeTopicPartition1.getPartition(), 12894, 2843));
  EasyMock.expect(offsetMonitor.getTopicPartitionOffset(fakeTopicPartition2)).andReturn(
      new TopicPartitionLag(fakeTopicPartition2.getTopic(), fakeTopicPartition2.getPartition(), 89600093, 2843));
  EasyMock.replay(workloadInfoRetriever, offsetMonitor);
  TopicPartitionLag lag = helixMirrorMakerManager.calculateLagTime(fakeTopicPartition1);
  Assert.assertNull(lag);
  TopicPartitionLag lag2 = helixMirrorMakerManager.calculateLagTime(fakeTopicPartition2);
  Assert.assertEquals(lag2.getLagTime(), 5563);
}