DynamoHolder { public void clearAll() { mDynamoMap.clear(); } DynamoHolder(int maxSize); T getDynamo(String meta, DynamoFactory<T> dynamoFactory); void clearAll(); void clear(String meta); Map<String, T> getAll();  }
@Test public void testClearAll() { final String DYNAMO_NAME = "testMeta1"; DynamoHolder<TestDynamo> testDynamoHolder = new DynamoHolder<TestDynamo>(2); DynamoHolder.DynamoFactory dynamoFactory = new DynamoHolder.DynamoFactory<TestDynamo>() { @Override public TestDynamo buildDynamo() { return new TestDynamo(); } }; Dynamo firstDynamoRequest = testDynamoHolder.getDynamo(DYNAMO_NAME, dynamoFactory); Dynamo secondDynamoRequest = testDynamoHolder.getDynamo(DYNAMO_NAME, dynamoFactory); Assert.assertEquals(firstDynamoRequest, secondDynamoRequest); testDynamoHolder.clearAll(); Dynamo thirdDynamoRequest = testDynamoHolder.getDynamo(DYNAMO_NAME, dynamoFactory); Assert.assertNotEquals(thirdDynamoRequest, secondDynamoRequest); }