@Test
  public void testParallelismAndMetrics() throws InterruptedException {
    this.containerStorageManager.start();
    this.containerStorageManager.shutdown();

    for (Gauge gauge : taskRestoreMetricGauges.values()) {
      Assert.assertTrue("Restoration time gauge value should be invoked atleast once",
          mockingDetails(gauge).getInvocations().size() >= 1);
    }

    Assert.assertEquals("Store restore count should be 2 because there are 2 tasks", 2, this.storeRestoreCallCount);
    Assert.assertEquals("systemConsumerCreation count should be 1 (1 consumer per system)", 1,
        this.systemConsumerCreationCount);
    Assert.assertEquals("systemConsumerStopCount count should be 1", 1, this.systemConsumerStopCount);
    Assert.assertEquals("systemConsumerStartCount count should be 1", 1, this.systemConsumerStartCount);
  }
Method to create a containerStorageManager with mocked dependencies
samza-core/src/test/scala/org/apache/samza/storage/TestContainerStorageManager.java