### Question:
GoogleAppsChangeLogConsumer extends ChangeLogConsumerBase { protected void processGroupAdd(GoogleAppsChangeLogConsumer consumer, ChangeLogEntry changeLogEntry) { LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Processing group add.", consumerName, toString(changeLogEntry)); final String groupName = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.GROUP_ADD.name); final edu.internet2.middleware.grouper.Group group = connector.fetchGrouperGroup(groupName); if (!connector.shouldSyncGroup(group)) { LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Skipping group add, nothing to do cause the group is not flagged or is gone.", consumerName, toString(changeLogEntry)); return; } try { connector.createGooGroupIfNecessary(group); } catch (IOException e) { LOG.error("Google Apps Consumer '{}' - Change log entry '{}' Error processing group add: {}", new Object[] {consumerName, toString(changeLogEntry), e}); } } GoogleAppsChangeLogConsumer(); @Override long processChangeLogEntries(final List<ChangeLogEntry> changeLogEntryList,
                                        ChangeLogProcessorMetadata changeLogProcessorMetadata);  }### Answer:
@Test public void testProcessGroupAdd() throws GeneralSecurityException, IOException { ChangeLogEntry addEntry = mock(ChangeLogEntry.class); when(addEntry.getChangeLogType()).thenReturn(new ChangeLogType("group", "addGroup", "")); when(addEntry.retrieveValueForLabel(ChangeLogLabels.GROUP_ADD.name)).thenReturn(groupName); when(addEntry.getContextId()).thenReturn("123456789"); ArrayList<ChangeLogEntry> changeLogEntryList = new ArrayList<ChangeLogEntry>(Arrays.asList(addEntry)); consumer.processChangeLogEntries(changeLogEntryList, metadata); Group group = GoogleAppsSdkUtils.retrieveGroup(directory, addressFormatter.qualifyGroupAddress(groupName)); assertNotNull(group); assertTrue(group.getName().equalsIgnoreCase(groupDisplayName)); }