@Test
public void ShouldCorrectLoadPlugin() throws Exception {

    IKey collectionNameKey = mock(IKey.class);
    when(Keys.getOrAdd(CollectionName.class.getCanonicalName())).thenReturn(collectionNameKey);
    BootstrapItem bootstrapItem = mock(BootstrapItem.class);
    whenNew(BootstrapItem.class).withArguments("CollectionNamePlugin").thenReturn(bootstrapItem);
    when(bootstrapItem.after(anyString())).thenReturn(bootstrapItem);
    when(bootstrapItem.before(anyString())).thenReturn(bootstrapItem);
    HashMap<String, CollectionName> collectionMap = mock(HashMap.class);
    whenNew(HashMap.class).withNoArguments().thenReturn(collectionMap);
    plugin.load();
    verifyNew(BootstrapItem.class).withArguments("CollectionNamePlugin");
    ArgumentCaptor<IPoorAction> actionArgumentCaptor = ArgumentCaptor.forClass(IPoorAction.class);
    verify(bootstrapItem).process(actionArgumentCaptor.capture());
    ArgumentCaptor<ResolveByNameIocStrategy> createNewInstanceStrategyArgumentCaptor =
        ArgumentCaptor.forClass(ResolveByNameIocStrategy.class);
    actionArgumentCaptor.getValue().execute();
    verifyStatic();
    IOC.register(eq(collectionNameKey), createNewInstanceStrategyArgumentCaptor.capture());
    String collectionNameStr = "collectionName";
    CollectionName collectionName = mock(CollectionName.class);
    when(CollectionName.fromString(collectionNameStr)).thenReturn(collectionName);
    assertEquals(createNewInstanceStrategyArgumentCaptor.getValue().resolve(collectionNameStr), collectionName);
    verifyStatic();
    CollectionName.fromString(eq(collectionNameStr));
    verify(bootstrap).add(bootstrapItem);
}