### Question:
DefaultDataGroupAndTypeFactory implements DataGroupAndTypeFactory { @Override public DefaultDataGroupInfo createGroup(Toolbox toolbox, String providerType, String folderName, Consumer<DataGroupInfo> deleteListener) { DefaultDataGroupInfo group; if (deleteListener != null) { group = new DefaultDeletableDataGroupInfo(false, toolbox, providerType, folderName); group.setAssistant(new DeletableDataGroupInfoAssistant(MantleToolboxUtils.getMantleToolbox(toolbox), null, null, deleteListener)); } else { group = new DefaultDataGroupInfo(false, toolbox, providerType, folderName); } return group; }  @Override DefaultDataGroupInfo createGroup(Toolbox toolbox, String providerType, String folderName,
            Consumer<DataGroupInfo> deleteListener); @Override DefaultDataTypeInfo createType(Toolbox toolbox, String providerType, String id, String typeName, String layerName);  }### Answer:
@Test public void testCreateGroup() { EasyMockSupport support = new EasyMockSupport(); Toolbox toolbox = support.createMock(Toolbox.class); support.replayAll(); DefaultDataGroupAndTypeFactory factory = new DefaultDataGroupAndTypeFactory(); DefaultDataGroupInfo group = factory.createGroup(toolbox, ourProviderType, ourFolderName, null); assertEquals(toolbox, group.getToolbox()); assertEquals(ourProviderType, group.getProviderType()); assertEquals(ourFolderName, group.getDisplayName()); support.verifyAll(); }
@Test public void testCreateGroupDelete() { EasyMockSupport support = new EasyMockSupport(); MantleToolbox mantle = support.createMock(MantleToolbox.class); Toolbox toolbox = createToolbox(support, mantle); @SuppressWarnings("unchecked") Consumer<DataGroupInfo> deleteListener = support.createMock(Consumer.class); support.replayAll(); DefaultDataGroupAndTypeFactory factory = new DefaultDataGroupAndTypeFactory(); DefaultDataGroupInfo group = factory.createGroup(toolbox, ourProviderType, ourFolderName, deleteListener); assertEquals(toolbox, group.getToolbox()); assertEquals(ourProviderType, group.getProviderType()); assertEquals(ourFolderName, group.getDisplayName()); assertTrue(group instanceof DefaultDeletableDataGroupInfo); assertTrue(group.getAssistant() instanceof DeletableDataGroupInfoAssistant); support.verifyAll(); }