    private void updateStats(final IngestHelperInterface helper, final RawRecordContainer event, final Multimap<String,NormalizedContentInterface> fields) {
        Set<SimpleFeature> features = null;
        try {
            features = createSimpleFeature(helper, event, fields);
        } catch (ParseException e) {
            e.printStackTrace();
        }

        final byte[] visibility = (event.getVisibility() != null) ? event.getVisibility().getExpression() : new byte[] {};

        if (features != null) {
            for (final SimpleFeature feature : features) {
                if (feature.getDefaultGeometry() != null) {
                    final DataStoreEntryInfo ingestInfo = DataStoreUtils.getIngestInfo(dataAdapter, index, feature, new UniformVisibilityWriter<>(
                                    new GlobalVisibilityHandler<>(StringUtils.stringFromBinary(visibility))));

                    bboxStats.entryIngested(ingestInfo, feature);
                    rowStats.entryIngested(ingestInfo, feature);
                }
            }
        }
    }

    private void updateStats(final IngestHelperInterface helper, final RawRecordContainer event, final Multimap<String,NormalizedContentInterface> fields) {
        Set<SimpleFeature> features = null;
        try {
            features = createSimpleFeature(helper, event, fields);
        } catch (ParseException e) {
            e.printStackTrace();
        }

        final byte[] visibility = (event.getVisibility() != null) ? event.getVisibility().getExpression() : new byte[] {};

        if (features != null) {
            for (final SimpleFeature feature : features) {
                if (feature.getDefaultGeometry() != null) {
                    final DataStoreEntryInfo ingestInfo = DataStoreUtils.getIngestInfo(dataAdapter, index, feature, new UniformVisibilityWriter<SimpleFeature>(
                                    new GlobalVisibilityHandler<SimpleFeature,Object>(StringUtils.stringFromBinary(visibility))));

                    bboxStats.entryIngested(ingestInfo, feature);
                    rowStats.entryIngested(ingestInfo, feature);
                }
            }
        }
    }

Replace Generic With Diamond UniformVisibilityWriter<SimpleFeature> with UniformVisibilityWriter<> in method private updateStats(helper IngestHelperInterface, event RawRecordContainer, fields Multimap<String,NormalizedContentInterface>) : void from class datawave.ingest.metadata.GeoWaveMetadata


    private Set<SimpleFeature> createSimpleFeature(final IngestHelperInterface helper, final RawRecordContainer event,
                    final Multimap<String,NormalizedContentInterface> fields) throws ParseException {
        final Set<SimpleFeature> features = new HashSet<>();
        for (final SimpleFeature feature : GeoWaveDataTypeHandler.eventToSimpleFeatures(helper, event, fields, builder, flattenGeometry))
            features.add(FeatureDataUtils.defaultCRSTransform(feature, originalType, reprojectedType, transform));
        return features;
    }

    private Set<SimpleFeature> createSimpleFeature(final IngestHelperInterface helper, final RawRecordContainer event,
                    final Multimap<String,NormalizedContentInterface> fields) throws ParseException {
        final Set<SimpleFeature> features = new HashSet<SimpleFeature>();
        for (final SimpleFeature feature : GeoWaveDataTypeHandler.eventToSimpleFeatures(helper, event, fields, builder, flattenGeometry))
            features.add(FeatureDataUtils.defaultCRSTransform(feature, originalType, reprojectedType, transform));
        return features;
    }

Replace Generic With Diamond HashSet<SimpleFeature> with HashSet<> in method private createSimpleFeature(helper IngestHelperInterface, event RawRecordContainer, fields Multimap<String,NormalizedContentInterface>) : Set<SimpleFeature> from class datawave.ingest.metadata.GeoWaveMetadata


    @Override
    public boolean propogateKey() {

        /**
         * Changed logic so that if seenIgnore is true and count > MAX, we keep propogate the key
         */
        if ((seenIgnore && count > maxUids) || quarantinedIds.size() > 0)
            return true;

        HashSet<String> uidsCopy = new HashSet<>(uids);
        uidsCopy.removeAll(uidsToRemove);

        if (log.isDebugEnabled()) {
            log.debug(count + " " + uids.size() + " " + uidsToRemove.size() + " " + uidsCopy.size() + " removing " + (count == 0 && uidsCopy.size() == 0));
        }

        // if <= 0 and uids is empty, we can safely remove
        if (count <= 0 && uidsCopy.size() == 0)
            return false;
        else
            return true;
    }

    @Override
    public boolean propogateKey() {

        /**
         * Changed logic so that if seenIgnore is true and count > MAX, we keep propogate the key
         */
        if ((seenIgnore && count > maxUids) || quarantinedIds.size() > 0)
            return true;

        HashSet<String> uidsCopy = new HashSet<String>(uids);
        uidsCopy.removeAll(uidsToRemove);

        if (log.isDebugEnabled()) {
            log.debug(count + " " + uids.size() + " " + uidsToRemove.size() + " " + uidsCopy.size() + " removing " + (count == 0 && uidsCopy.size() == 0));
        }

        // if <= 0 and uids is empty, we can safely remove
        if (count <= 0 && uidsCopy.size() == 0)
            return false;
        else
            return true;
    }

Replace Generic With Diamond HashSet<String> with HashSet<> in method public propogateKey() : boolean from class datawave.ingest.table.aggregator.GlobalIndexUidAggregator


    private void attachIterators(final TableOperations tops, final String tableName, final IteratorConfig[] iterators) throws TableNotFoundException,
                    AccumuloSecurityException, AccumuloException {
        try {
            if ((iterators != null) && (iterators.length > 0)) {
                final Map<String,EnumSet<IteratorUtil.IteratorScope>> iteratorScopes = tops.listIterators(tableName);
                for (final IteratorConfig iteratorConfig : iterators) {
                    boolean mustDelete = false;
                    boolean exists = false;
                    final EnumSet<IteratorUtil.IteratorScope> existingScopes = iteratorScopes.get(iteratorConfig.getIteratorName());
                    EnumSet<IteratorUtil.IteratorScope> configuredScopes;
                    if (iteratorConfig.getScopes() == null) {
                        configuredScopes = EnumSet.allOf(IteratorUtil.IteratorScope.class);
                    } else {
                        configuredScopes = iteratorConfig.getScopes();
                    }
                    Map<String,String> configuredOptions = null;
                    if (existingScopes != null) {
                        if (existingScopes.size() == configuredScopes.size()) {
                            exists = true;
                            for (final IteratorUtil.IteratorScope s : existingScopes) {
                                if (!configuredScopes.contains(s)) {
                                    // this iterator exists with the wrong
                                    // scope, we will assume we want to remove
                                    // it and add the new configuration
                                    log.warn("found iterator '" + iteratorConfig.getIteratorName() + "' missing scope '" + s.name()
                                                    + "', removing it and re-attaching");

                                    mustDelete = true;
                                    break;
                                }
                            }
                        }
                        if (existingScopes.size() > 0) {
                            // see if the options are the same, if they are not
                            // the same, apply a merge with the existing options
                            // and the configured options
                            final Iterator<IteratorUtil.IteratorScope> it = existingScopes.iterator();
                            while (it.hasNext()) {
                                final IteratorUtil.IteratorScope scope = it.next();
                                final IteratorSetting setting = tops.getIteratorSetting(tableName, iteratorConfig.getIteratorName(), scope);
                                if (setting != null) {
                                    final Map<String,String> existingOptions = setting.getOptions();
                                    configuredOptions = iteratorConfig.getOptions(existingOptions);
                                    // we found the setting existing in one
                                    // scope, assume the options are the same
                                    // for each scope
                                    mustDelete = true;
                                    break;
                                }
                            }
                        }
                    }
                    if (mustDelete) {
                        tops.removeIterator(tableName, iteratorConfig.getIteratorName(), existingScopes);
                        exists = false;
                    }
                    if (!exists) {
                        if (configuredOptions == null) {
                            configuredOptions = iteratorConfig.getOptions(new HashMap<>());
                        }
                        tops.attachIterator(tableName, new IteratorSetting(iteratorConfig.getIteratorPriority(), iteratorConfig.getIteratorName(),
                                        iteratorConfig.getIteratorClass(), configuredOptions), configuredScopes);
                    }
                }
            }
        } catch (AccumuloException | AccumuloSecurityException e) {
            log.warn("Unable to create table '" + tableName + "'", e);
        }
    }

    private void attachIterators(final TableOperations tops, final String tableName, final IteratorConfig[] iterators) throws TableNotFoundException,
                    AccumuloSecurityException, AccumuloException {
        try {
            if ((iterators != null) && (iterators.length > 0)) {
                final Map<String,EnumSet<IteratorUtil.IteratorScope>> iteratorScopes = tops.listIterators(tableName);
                for (final IteratorConfig iteratorConfig : iterators) {
                    boolean mustDelete = false;
                    boolean exists = false;
                    final EnumSet<IteratorUtil.IteratorScope> existingScopes = iteratorScopes.get(iteratorConfig.getIteratorName());
                    EnumSet<IteratorUtil.IteratorScope> configuredScopes;
                    if (iteratorConfig.getScopes() == null) {
                        configuredScopes = EnumSet.allOf(IteratorUtil.IteratorScope.class);
                    } else {
                        configuredScopes = iteratorConfig.getScopes();
                    }
                    Map<String,String> configuredOptions = null;
                    if (existingScopes != null) {
                        if (existingScopes.size() == configuredScopes.size()) {
                            exists = true;
                            for (final IteratorUtil.IteratorScope s : existingScopes) {
                                if (!configuredScopes.contains(s)) {
                                    // this iterator exists with the wrong
                                    // scope, we will assume we want to remove
                                    // it and add the new configuration
                                    log.warn("found iterator '" + iteratorConfig.getIteratorName() + "' missing scope '" + s.name()
                                                    + "', removing it and re-attaching");

                                    mustDelete = true;
                                    break;
                                }
                            }
                        }
                        if (existingScopes.size() > 0) {
                            // see if the options are the same, if they are not
                            // the same, apply a merge with the existing options
                            // and the configured options
                            final Iterator<IteratorUtil.IteratorScope> it = existingScopes.iterator();
                            while (it.hasNext()) {
                                final IteratorUtil.IteratorScope scope = it.next();
                                final IteratorSetting setting = tops.getIteratorSetting(tableName, iteratorConfig.getIteratorName(), scope);
                                if (setting != null) {
                                    final Map<String,String> existingOptions = setting.getOptions();
                                    configuredOptions = iteratorConfig.getOptions(existingOptions);
                                    // we found the setting existing in one
                                    // scope, assume the options are the same
                                    // for each scope
                                    mustDelete = true;
                                    break;
                                }
                            }
                        }
                    }
                    if (mustDelete) {
                        tops.removeIterator(tableName, iteratorConfig.getIteratorName(), existingScopes);
                        exists = false;
                    }
                    if (!exists) {
                        if (configuredOptions == null) {
                            configuredOptions = iteratorConfig.getOptions(new HashMap<String,String>());
                        }
                        tops.attachIterator(tableName, new IteratorSetting(iteratorConfig.getIteratorPriority(), iteratorConfig.getIteratorName(),
                                        iteratorConfig.getIteratorClass(), configuredOptions), configuredScopes);
                    }
                }
            }
        } catch (AccumuloException | AccumuloSecurityException e) {
            log.warn("Unable to create table '" + tableName + "'", e);
        }
    }

Replace Generic With Diamond HashMap<String,String> with HashMap<> in method private attachIterators(tops TableOperations, tableName String, iterators IteratorConfig[]) : void from class datawave.ingest.table.config.GeoWaveTableConfigHelper


    private void addLocalityGroup(final TableOperations tops, final String tableName, final String localityGroup) throws AccumuloException,
                    TableNotFoundException, AccumuloSecurityException {
        if (tops.exists(tableName)) {
            final Map<String,Set<Text>> localityGroups = tops.getLocalityGroups(tableName);

            final Set<Text> groupSet = new HashSet<>();

            groupSet.add(new Text(localityGroup));

            localityGroups.put(localityGroup, groupSet);

            tops.setLocalityGroups(tableName, localityGroups);
        }
    }

    private void addLocalityGroup(final TableOperations tops, final String tableName, final String localityGroup) throws AccumuloException,
                    TableNotFoundException, AccumuloSecurityException {
        if (tops.exists(tableName)) {
            final Map<String,Set<Text>> localityGroups = tops.getLocalityGroups(tableName);

            final Set<Text> groupSet = new HashSet<Text>();

            groupSet.add(new Text(localityGroup));

            localityGroups.put(localityGroup, groupSet);

            tops.setLocalityGroups(tableName, localityGroups);
        }
    }

Replace Generic With Diamond HashSet<Text> with HashSet<> in method private addLocalityGroup(tops TableOperations, tableName String, localityGroup String) : void from class datawave.ingest.table.config.GeoWaveTableConfigHelper


    @Override
    public Multimap<String,NormalizedContentInterface> getEventFields(RawRecordContainer event) {
        Multimap<String,NormalizedContentInterface> eventFields = HashMultimap.create();
        Map<String,String> markings = new HashMap<>();
        markings.put("P", "PERSONAL");

        eventFields.put("FAKE_FIELD", new NormalizedFieldAndValue("FAKE_FIELD", "fake value", markings));
        return eventFields;
    }

    @Override
    public Multimap<String,NormalizedContentInterface> getEventFields(RawRecordContainer event) {
        Multimap<String,NormalizedContentInterface> eventFields = HashMultimap.create();
        Map<String,String> markings = new HashMap<String,String>();
        markings.put("P", "PERSONAL");

        eventFields.put("FAKE_FIELD", new NormalizedFieldAndValue("FAKE_FIELD", "fake value", markings));
        return eventFields;
    }

Replace Generic With Diamond HashMap<String,String> with HashMap<> in method public getEventFields(event RawRecordContainer) : Multimap<String,NormalizedContentInterface> from class datawave.ingest.data.config.ingest.FakeIngestHelper


    @Test
    public void testSetup() {
        conf.set("test.data.category.index.aliases.enabled", "true");
        conf.set("test.data.category.index.aliases", "FOO_1:BAR_1,BAR_2;FOO_2:BAR_3");
        conf.set("test.data.category.field.aliases", "HELLOWORLD:HELLO_WORLD");

        FieldNameAliaserNormalizer fnan = new FieldNameAliaserNormalizer();
        fnan.setup(TypeRegistry.getType("test"), conf);

        Map<String,String> expectedFieldAliases = new HashMap<>();
        expectedFieldAliases.put("HELLOWORLD", "HELLO_WORLD");

        Assert.assertEquals(expectedFieldAliases, fnan.getAliases());
        Assert.assertEquals(2, fnan.getIndexAliases("FOO_1").size());
        Assert.assertEquals(1, fnan.getIndexAliases("FOO_2").size());
    }

    @Test
    public void testSetup() {
        conf.set("test.data.category.index.aliases.enabled", "true");
        conf.set("test.data.category.index.aliases", "FOO_1:BAR_1,BAR_2;FOO_2:BAR_3");
        conf.set("test.data.category.field.aliases", "HELLOWORLD:HELLO_WORLD");

        FieldNameAliaserNormalizer fnan = new FieldNameAliaserNormalizer();
        fnan.setup(TypeRegistry.getType("test"), conf);

        Map<String,String> expectedFieldAliases = new HashMap<String,String>();
        expectedFieldAliases.put("HELLOWORLD", "HELLO_WORLD");

        Assert.assertEquals(expectedFieldAliases, fnan.getAliases());
        Assert.assertEquals(2, fnan.getIndexAliases("FOO_1").size());
        Assert.assertEquals(1, fnan.getIndexAliases("FOO_2").size());
    }

Replace Generic With Diamond HashMap<String,String> with HashMap<> in method public testSetup() : void from class datawave.ingest.data.config.ingest.FieldNameAliaserNormalizerTest


    @Before
    public void setup() throws Exception {

        conf = new Configuration();
        conf.set("num.shards", "11");
        conf.set("data.name", "testdatatype");
        conf.set("testdatatype.ingest.helper.class", TestBaseIngestHelper.class.getName());
        conf.set("testdatatype.handler.classes", DateIndexDataTypeHandler.class.getName());

        // date index configuration
        conf.set("date.index.table.name", "DateIndex");
        conf.set("date.index.table.loader.priority", "30");
        conf.set("DateIndex.table.config.class", DateIndexTableConfigHelper.class.getName());
        conf.set("date.index.table.locality.groups", "activity:ACTIVITY,loaded:LOADED");

        // some date index configuration for our "testdatatype" events
        conf.set("testdatatype.date.index.type.to.field.map", "ACTIVITY=ACTIVITY_DATE,LOADED=LOAD_DATE");
        conf.set("all" + Properties.INGEST_POLICY_ENFORCER_CLASS, IngestPolicyEnforcer.NoOpIngestPolicyEnforcer.class.getName());

        TypeRegistry.reset();
        TypeRegistry.getInstance(conf);

        handler = new DateIndexDataTypeHandler<>();
        handler.setup(new TaskAttemptContextImpl(conf, new TaskAttemptID()));
    }

    @Before
    public void setup() throws Exception {

        conf = new Configuration();
        conf.set("num.shards", "11");
        conf.set("data.name", "testdatatype");
        conf.set("testdatatype.ingest.helper.class", TestBaseIngestHelper.class.getName());
        conf.set("testdatatype.handler.classes", DateIndexDataTypeHandler.class.getName());

        // date index configuration
        conf.set("date.index.table.name", "DateIndex");
        conf.set("date.index.table.loader.priority", "30");
        conf.set("DateIndex.table.config.class", DateIndexTableConfigHelper.class.getName());
        conf.set("date.index.table.locality.groups", "activity:ACTIVITY,loaded:LOADED");

        // some date index configuration for our "testdatatype" events
        conf.set("testdatatype.date.index.type.to.field.map", "ACTIVITY=ACTIVITY_DATE,LOADED=LOAD_DATE");
        conf.set("all" + Properties.INGEST_POLICY_ENFORCER_CLASS, IngestPolicyEnforcer.NoOpIngestPolicyEnforcer.class.getName());

        TypeRegistry.reset();
        TypeRegistry.getInstance(conf);

        handler = new DateIndexDataTypeHandler<Text>();
        handler.setup(new TaskAttemptContextImpl(conf, new TaskAttemptID()));
    }

Replace Generic With Diamond DateIndexDataTypeHandler<Text> with DateIndexDataTypeHandler<> in method public setup() : void from class datawave.ingest.mapreduce.handler.dateindex.DateIndexDataTypeHandlerTest


    @Test
    public void testMerge() {

        Set<Integer> bits = new HashSet<>();
        for (int i = 0; i < 40; i++) {
            bits.add(i);
            bits.add(i * 2);
            bits.add(i * 3);
        }

        BitSet bitSet1 = new BitSet(1);
        BitSet bitSet2 = new BitSet(1);
        int count = 0;
        for (Integer i : bits) {
            if (count % 2 == 0) {
                bitSet1 = DateIndexUtil.merge(bitSet1, DateIndexUtil.getBits(i));
            } else {
                bitSet2 = DateIndexUtil.merge(bitSet2, DateIndexUtil.getBits(i));
            }
        }
        BitSet bitSet = DateIndexUtil.merge(bitSet1, bitSet2);

        for (int i = 0; i < 40 * 4; i++) {
            if (bits.contains(i)) {
                Assert.assertTrue(bitSet.get(i));
            } else {
                Assert.assertFalse(bitSet.get(i));
            }
        }
    }

    @Test
    public void testMerge() {

        Set<Integer> bits = new HashSet<Integer>();
        for (int i = 0; i < 40; i++) {
            bits.add(i);
            bits.add(i * 2);
            bits.add(i * 3);
        }

        BitSet bitSet1 = new BitSet(1);
        BitSet bitSet2 = new BitSet(1);
        int count = 0;
        for (Integer i : bits) {
            if (count % 2 == 0) {
                bitSet1 = DateIndexUtil.merge(bitSet1, DateIndexUtil.getBits(i));
            } else {
                bitSet2 = DateIndexUtil.merge(bitSet2, DateIndexUtil.getBits(i));
            }
        }
        BitSet bitSet = DateIndexUtil.merge(bitSet1, bitSet2);

        for (int i = 0; i < 40 * 4; i++) {
            if (bits.contains(i)) {
                Assert.assertTrue(bitSet.get(i));
            } else {
                Assert.assertFalse(bitSet.get(i));
            }
        }
    }

Replace Generic With Diamond HashSet<Integer> with HashSet<> in method public testMerge() : void from class datawave.ingest.mapreduce.handler.dateindex.DateIndexUtilTest


        public static void processEvent(Multimap<String,NormalizedContentInterface> eventFields, ExtendedDataTypeHandler<Text,BulkIngestKey,Value> edgeHandler,
                        RawRecordContainer event, int expectedEdgeKeys, boolean printKeysOnlyOnFail, boolean edgeDeleteMode) {

            Assert.assertNotNull("Event was null.", event);
            Set<Key> edgeKeys = new HashSet<>();
            Map<Text,Integer> countMap = Maps.newHashMap();

            // Process edges
            countMap.put(edgeTableName, 0);
            if (null != edgeHandler) {
                HandlerTestUtil.MyCachingContextWriter contextWriter = new HandlerTestUtil.MyCachingContextWriter();
                StandaloneTaskAttemptContext<Text,RawRecordContainerImpl,BulkIngestKey,Value> ctx = new StandaloneTaskAttemptContext<>(
                                ((RawRecordContainerImpl) event).getConf(), new StandaloneStatusReporter());

                try {
                    contextWriter.setup(ctx.getConfiguration(), false);
                    edgeHandler.process(null, event, eventFields, ctx, contextWriter);
                    contextWriter.commit(ctx);
                    for (Map.Entry<BulkIngestKey,Value> entry : contextWriter.getCache().entries()) {
                        if (entry.getKey().getTableName().equals(edgeTableName)) {
                            edgeKeys.add(entry.getKey().getKey());
                        }
                        if (!entry.getKey().getTableName().equals(edgeTableName) || entry.getKey().getKey().isDeleted() == edgeDeleteMode) {
                            if (countMap.containsKey(entry.getKey().getTableName())) {
                                countMap.put(entry.getKey().getTableName(), countMap.get(entry.getKey().getTableName()) + 1);
                            } else {
                                countMap.put(entry.getKey().getTableName(), 1);
                            }
                        }
                    }
                } catch (Throwable t) {
                    log.error("Error during edge processing", t);
                    throw new RuntimeException(t);
                }
            }

            Set<String> keyPrint = new TreeSet<>();

            // check edge keys
            for (Key k : edgeKeys) {
                keyPrint.add("edge key: " + k.getRow().toString().replaceAll(NB, "%00;") + " ::: " + k.getColumnFamily().toString().replaceAll(NB, "%00;")
                                + " ::: " + k.getColumnQualifier().toString().replaceAll(NB, "%00;") + " ::: " + k.getColumnVisibility() + " ::: "
                                + k.getTimestamp() + " ::: " + k.isDeleted() + "\n");
            }

            try {
                if (!printKeysOnlyOnFail) {
                    for (String keyString : keyPrint) {
                        log.info(keyString.trim());
                    }
                }
                Assert.assertTrue(countMap.get(edgeTableName) == expectedEdgeKeys);
            } catch (AssertionError ae) {
                if (printKeysOnlyOnFail) {
                    for (String keyString : keyPrint) {
                        log.info(keyString.trim());
                    }
                }
                Assert.fail(String.format("Expected: %s edge keys.\nFound: %s", expectedEdgeKeys, countMap.get(shardTableName), countMap.get(edgeTableName)));
            }
        }

        public static void processEvent(Multimap<String,NormalizedContentInterface> eventFields, ExtendedDataTypeHandler<Text,BulkIngestKey,Value> edgeHandler,
                        RawRecordContainer event, int expectedEdgeKeys, boolean printKeysOnlyOnFail, boolean edgeDeleteMode) {

            Assert.assertNotNull("Event was null.", event);
            Set<Key> edgeKeys = new HashSet<>();
            Map<Text,Integer> countMap = Maps.newHashMap();

            // Process edges
            countMap.put(edgeTableName, 0);
            if (null != edgeHandler) {
                HandlerTestUtil.MyCachingContextWriter contextWriter = new HandlerTestUtil.MyCachingContextWriter();
                StandaloneTaskAttemptContext<Text,RawRecordContainerImpl,BulkIngestKey,Value> ctx = new StandaloneTaskAttemptContext<>(
                                ((RawRecordContainerImpl) event).getConf(), new StandaloneStatusReporter());

                try {
                    contextWriter.setup(ctx.getConfiguration(), false);
                    edgeHandler.process(null, event, eventFields, ctx, contextWriter);
                    contextWriter.commit(ctx);
                    for (Map.Entry<BulkIngestKey,Value> entry : contextWriter.getCache().entries()) {
                        if (entry.getKey().getTableName().equals(edgeTableName)) {
                            edgeKeys.add(entry.getKey().getKey());
                        }
                        if (!entry.getKey().getTableName().equals(edgeTableName) || entry.getKey().getKey().isDeleted() == edgeDeleteMode) {
                            if (countMap.containsKey(entry.getKey().getTableName())) {
                                countMap.put(entry.getKey().getTableName(), countMap.get(entry.getKey().getTableName()) + 1);
                            } else {
                                countMap.put(entry.getKey().getTableName(), 1);
                            }
                        }
                    }
                } catch (Throwable t) {
                    log.error("Error during edge processing", t);
                    throw new RuntimeException(t);
                }
            }

            Set<String> keyPrint = new TreeSet<String>();

            // check edge keys
            for (Key k : edgeKeys) {
                keyPrint.add("edge key: " + k.getRow().toString().replaceAll(NB, "%00;") + " ::: " + k.getColumnFamily().toString().replaceAll(NB, "%00;")
                                + " ::: " + k.getColumnQualifier().toString().replaceAll(NB, "%00;") + " ::: " + k.getColumnVisibility() + " ::: "
                                + k.getTimestamp() + " ::: " + k.isDeleted() + "\n");
            }

            try {
                if (!printKeysOnlyOnFail) {
                    for (String keyString : keyPrint) {
                        log.info(keyString.trim());
                    }
                }
                Assert.assertTrue(countMap.get(edgeTableName) == expectedEdgeKeys);
            } catch (AssertionError ae) {
                if (printKeysOnlyOnFail) {
                    for (String keyString : keyPrint) {
                        log.info(keyString.trim());
                    }
                }
                Assert.fail(String.format("Expected: %s edge keys.\nFound: %s", expectedEdgeKeys, countMap.get(shardTableName), countMap.get(edgeTableName)));
            }
        }

Replace Generic With Diamond TreeSet<String> with TreeSet<> in method public processEvent(eventFields Multimap<String,NormalizedContentInterface>, edgeHandler ExtendedDataTypeHandler<Text,BulkIngestKey,Value>, event RawRecordContainer, expectedEdgeKeys int, printKeysOnlyOnFail boolean, edgeDeleteMode boolean) : void from class datawave.ingest.mapreduce.handler.edge.ProtubufEdgeDeleteModeTest.HandlerTestUtil


    @Before
    public void setup() throws Exception {
        systemProperties = new ArrayList<>();

        testDriverLevel = BulkIngestMapFileLoaderTest.logger.getLevel();
        BulkIngestMapFileLoaderTest.logger.setLevel(Level.ALL);

        Logger uutLogger = Logger.getLogger(BulkIngestMapFileLoader.class);
        uutAppender = new CommonTestAppender();

        uutLevel = uutLogger.getLevel();
        uutLogger.setLevel(Level.ALL);
        uutLogger.addAppender(uutAppender);

    }

    @Before
    public void setup() throws Exception {
        systemProperties = new ArrayList<String>();

        testDriverLevel = BulkIngestMapFileLoaderTest.logger.getLevel();
        BulkIngestMapFileLoaderTest.logger.setLevel(Level.ALL);

        Logger uutLogger = Logger.getLogger(BulkIngestMapFileLoader.class);
        uutAppender = new CommonTestAppender();

        uutLevel = uutLogger.getLevel();
        uutLogger.setLevel(Level.ALL);
        uutLogger.addAppender(uutAppender);

    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public setup() : void from class datawave.ingest.mapreduce.job.BulkIngestMapFileLoaderTest


    @Test
    public void testCleanUpJobDirectoryMakesDirectory() throws Exception {

        BulkIngestMapFileLoaderTest.logger.info("testCleanUpJobDirectoryMakesDirectory called...");

        try {

            URL url = BulkIngestMapFileLoaderTest.class.getResource("/datawave/ingest/mapreduce/job/all-splits.txt");

            String workDir = ".";
            String jobDirPattern = "jobs/";
            String instanceName = "localhost";
            String zooKeepers = "localhost";
            Credentials credentials = new Credentials("user", new PasswordToken("pass"));
            URI seqFileHdfs = url.toURI();
            URI srcHdfs = url.toURI();
            URI destHdfs = url.toURI();
            String jobtracker = "localhost";
            Map<String,Integer> tablePriorities = new HashMap<>();
            Configuration conf = new Configuration();

            BulkIngestMapFileLoader uut = new BulkIngestMapFileLoader(workDir, jobDirPattern, instanceName, zooKeepers, credentials, seqFileHdfs, srcHdfs,
                            destHdfs, jobtracker, tablePriorities, conf);

            Assert.assertNotNull("BulkIngestMapFileLoader constructor failed to create an instance.", uut);

            BulkIngestMapFileLoaderTest.WrappedLocalFileSystem fs = new BulkIngestMapFileLoaderTest.WrappedLocalFileSystem(createMockInputStream(), null, true,
                            false, false, false, new HashMap<>(), false, false);

            Whitebox.invokeMethod(FileSystem.class, "addFileSystemForTesting", BulkIngestMapFileLoaderTest.FILE_SYSTEM_URI, conf, fs);

            Path mapFilesDir = new Path(url.toString());

            uut.cleanUpJobDirectory(mapFilesDir);

            Assert.fail();

        } catch (URISyntaxException e) {

            Assert.fail("Class#getResource failed to return a valid URI");

        } catch (IOException ioe) {

            String msg = ioe.getMessage();

            Assert.assertTrue("BulkIngestMapFileLoader#markSourceFilesLoaded failed to throw the excepted IOException.", msg.startsWith("Unable to rename "));

        } catch (Throwable t) {

            Assert.fail(String.format("BulkIngestMapFileLoader unexpectedly threw an exception: %s with message of '%s'", t.getClass().getName(),
                            t.getMessage()));

        } finally {

            Whitebox.invokeMethod(FileSystem.class, "addFileSystemForTesting", BulkIngestMapFileLoaderTest.FILE_SYSTEM_URI, null, null);

            BulkIngestMapFileLoaderTest.logger.info("testCleanUpJobDirectoryMakesDirectory completed.");
        }

    }

    @Test
    public void testCleanUpJobDirectoryMakesDirectory() throws Exception {

        BulkIngestMapFileLoaderTest.logger.info("testCleanUpJobDirectoryMakesDirectory called...");

        try {

            URL url = BulkIngestMapFileLoaderTest.class.getResource("/datawave/ingest/mapreduce/job/all-splits.txt");

            String workDir = ".";
            String jobDirPattern = "jobs/";
            String instanceName = "localhost";
            String zooKeepers = "localhost";
            Credentials credentials = new Credentials("user", new PasswordToken("pass"));
            URI seqFileHdfs = url.toURI();
            URI srcHdfs = url.toURI();
            URI destHdfs = url.toURI();
            String jobtracker = "localhost";
            Map<String,Integer> tablePriorities = new HashMap<>();
            Configuration conf = new Configuration();

            BulkIngestMapFileLoader uut = new BulkIngestMapFileLoader(workDir, jobDirPattern, instanceName, zooKeepers, credentials, seqFileHdfs, srcHdfs,
                            destHdfs, jobtracker, tablePriorities, conf);

            Assert.assertNotNull("BulkIngestMapFileLoader constructor failed to create an instance.", uut);

            BulkIngestMapFileLoaderTest.WrappedLocalFileSystem fs = new BulkIngestMapFileLoaderTest.WrappedLocalFileSystem(createMockInputStream(), null, true,
                            false, false, false, new HashMap<String,Boolean>(), false, false);

            Whitebox.invokeMethod(FileSystem.class, "addFileSystemForTesting", BulkIngestMapFileLoaderTest.FILE_SYSTEM_URI, conf, fs);

            Path mapFilesDir = new Path(url.toString());

            uut.cleanUpJobDirectory(mapFilesDir);

            Assert.fail();

        } catch (URISyntaxException e) {

            Assert.fail("Class#getResource failed to return a valid URI");

        } catch (IOException ioe) {

            String msg = ioe.getMessage();

            Assert.assertTrue("BulkIngestMapFileLoader#markSourceFilesLoaded failed to throw the excepted IOException.", msg.startsWith("Unable to rename "));

        } catch (Throwable t) {

            Assert.fail(String.format("BulkIngestMapFileLoader unexpectedly threw an exception: %s with message of '%s'", t.getClass().getName(),
                            t.getMessage()));

        } finally {

            Whitebox.invokeMethod(FileSystem.class, "addFileSystemForTesting", BulkIngestMapFileLoaderTest.FILE_SYSTEM_URI, null, null);

            BulkIngestMapFileLoaderTest.logger.info("testCleanUpJobDirectoryMakesDirectory completed.");
        }

    }

Replace Generic With Diamond BulkIngestMapFileLoaderTest.WrappedLocalFileSystem with BulkIngestMapFileLoaderTest.WrappedLocalFileSystem in method public testCleanUpJobDirectoryMakesDirectory() : void from class datawave.ingest.mapreduce.job.BulkIngestMapFileLoaderTest


    @Test
    public void testTrimTableSplits() {
        setSplitsCacheDir();
        int reducers = 487;
        int numsplits = 195365;
        // generate the initial splits
        List<Text> splits = new ArrayList<>(numsplits);
        for (int i = 0; i < numsplits; i++) {
            splits.add(new Text(Integer.toString(i)));
        }
        List<Text> newSplits = MetadataTableSplits.trimSplits(splits, reducers - 1);
        Assert.assertEquals("split count", (reducers - 1), newSplits.size());
        Assert.assertEquals("first split", 401, Integer.parseInt(newSplits.get(0).toString()));
        Assert.assertEquals("num splits - last split", 402, numsplits - Integer.parseInt(newSplits.get(newSplits.size() - 1).toString()));
        int lastsplit = 0;
        for (int i = 0; i < newSplits.size(); i++) {
            int split = Integer.parseInt(newSplits.get(i).toString());
            Assert.assertTrue("split size", (split - lastsplit) >= 401);
            Assert.assertTrue("split size", (split - lastsplit) <= 402);
            lastsplit = split;
        }
    }

    @Test
    public void testTrimTableSplits() {
        setSplitsCacheDir();
        int reducers = 487;
        int numsplits = 195365;
        // generate the initial splits
        List<Text> splits = new ArrayList<Text>(numsplits);
        for (int i = 0; i < numsplits; i++) {
            splits.add(new Text(Integer.toString(i)));
        }
        List<Text> newSplits = MetadataTableSplits.trimSplits(splits, reducers - 1);
        Assert.assertEquals("split count", (reducers - 1), newSplits.size());
        Assert.assertEquals("first split", 401, Integer.parseInt(newSplits.get(0).toString()));
        Assert.assertEquals("num splits - last split", 402, numsplits - Integer.parseInt(newSplits.get(newSplits.size() - 1).toString()));
        int lastsplit = 0;
        for (int i = 0; i < newSplits.size(); i++) {
            int split = Integer.parseInt(newSplits.get(i).toString());
            Assert.assertTrue("split size", (split - lastsplit) >= 401);
            Assert.assertTrue("split size", (split - lastsplit) <= 402);
            lastsplit = split;
        }
    }

Replace Generic With Diamond ArrayList<Text> with ArrayList<> in method public testTrimTableSplits() : void from class datawave.ingest.mapreduce.job.MetadataTableSplitsTest


            @Override
            protected Set<String> getTableList() {
                Set<String> tables = new HashSet<>();
                tables.add("shard");
                tables.add("shardIndex");
                return tables;
            }

            @Override
            protected Set<String> getTableList() {
                Set<String> tables = new HashSet<String>();
                tables.add("shard");
                tables.add("shardIndex");
                return tables;
            }

Replace Generic With Diamond HashSet<String> with HashSet<> in method protected getTableList() : Set<String> from class datawave.ingest.mapreduce.job.MultiRFileOutputFormatterTest.createFormatter.new MultiRFileOutputFormatter


            @Override
            protected Map<Text,String> getShardLocations(String tableName) throws IOException {
                Map<Text,String> locations = new HashMap<>();
                locations.put(new Text("20100101_1"), "server1");
                locations.put(new Text("20100101_2"), "server2");
                return locations;
            }

            @Override
            protected Map<Text,String> getShardLocations(String tableName) throws IOException {
                Map<Text,String> locations = new HashMap<Text,String>();
                locations.put(new Text("20100101_1"), "server1");
                locations.put(new Text("20100101_2"), "server2");
                return locations;
            }

Replace Generic With Diamond HashMap<Text,String> with HashMap<> in method protected getShardLocations(tableName String) : Map<Text,String> from class datawave.ingest.mapreduce.job.MultiRFileOutputFormatterTest.createFormatter.new MultiRFileOutputFormatter


    @Before
    public void before() {
        formatter = createFormatter();
        conf = new Configuration();
        conf.set("mapred.output.dir", "/tmp");
        conf.set(MultiRFileOutputFormatter.CONFIGURED_TABLE_NAMES, "shard,shardIndex");
        Map<String,Path> shardedTableMapFiles = new HashMap<>();
        shardedTableMapFiles.put("shard", new Path("/tmp/shard"));
        ShardedTableMapFile.addToConf(conf, shardedTableMapFiles);
    }

    @Before
    public void before() {
        formatter = createFormatter();
        conf = new Configuration();
        conf.set("mapred.output.dir", "/tmp");
        conf.set(MultiRFileOutputFormatter.CONFIGURED_TABLE_NAMES, "shard,shardIndex");
        Map<String,Path> shardedTableMapFiles = new HashMap<String,Path>();
        shardedTableMapFiles.put("shard", new Path("/tmp/shard"));
        ShardedTableMapFile.addToConf(conf, shardedTableMapFiles);
    }

Replace Generic With Diamond HashMap<String,Path> with HashMap<> in method public before() : void from class datawave.ingest.mapreduce.job.MultiRFileOutputFormatterTest


    @Test
    public void testWriteSplitsFileNewPath() throws Exception {
        Configuration conf = new Configuration();
        Path file = createSplitsFile(new HashMap<>(), conf, 0);

        SequenceFile.Reader reader = new SequenceFile.Reader(conf, SequenceFile.Reader.file(file));
        Text key = new Text();
        Text val = new Text();
        boolean valid = reader.next(key, val);
        Assert.assertFalse(valid);
        reader.close();
    }

    @Test
    public void testWriteSplitsFileNewPath() throws Exception {
        Configuration conf = new Configuration();
        Path file = createSplitsFile(new HashMap<Text,String>(), conf, 0);

        SequenceFile.Reader reader = new SequenceFile.Reader(conf, SequenceFile.Reader.file(file));
        Text key = new Text();
        Text val = new Text();
        boolean valid = reader.next(key, val);
        Assert.assertFalse(valid);
        reader.close();
    }

Replace Generic With Diamond HashMap<Text,String> with HashMap<> in method public testWriteSplitsFileNewPath() : void from class datawave.ingest.mapreduce.job.ShardedTableMapFileTest


    @Test
    public void testDifferentNumberShardPerDayCollapse() throws IOException {
        // Create SHARDS_PER_DAY splits for today, yesterday and the day before
        // Create 2 splits (_0 and _1) for 3 and 4 days ago.
        //
        // Now use the collapse strategy so days 3 and 4 only get split into 1 reducer
        // per existing split in Accumulo.
        //
        // This emulates a day having fewer splits for performance reasons because you don't expect
        // enough data to warrant the full compliment of splits and the overhead in the tserver of
        // tracking all those splits. The job will still generate data with row ids up to
        // SHARDS_PER_DAY, but simply write the same number of rfiles as splits.
        // See issues #45
        String tableName = "shard2";
        simulateDifferentNumberShardsPerDay("collapse", tableName);

        // 1 day ago should get SHARDS_PER_DAY partitions
        assertPartitionsForDay(partitioner, tableName, 1, SHARDS_PER_DAY);

        // 3 days ago should get 3 partitions, the _1, the _2 and the next days _0
        assertPartitionsForDay(partitioner, tableName, 3, 3);

        // now let's check they went in the right place
        Map<Integer,List<String>> reducers = new TreeMap<>();
        String formattedDay = formatDay(3);
        for (int i = 0; i < SHARDS_PER_DAY; i++) {
            String shardId = formattedDay + ("_" + i);
            int partition = partitioner.getPartition(new BulkIngestKey(new Text(tableName), new Key(shardId)), new Value(), NUM_REDUCE_TASKS);
            if (!reducers.containsKey(partition)) {
                reducers.put(partition, new ArrayList<>());
            }
            reducers.get(partition).add(shardId);
        }
        assertEquals(3, reducers.size());
        // partitions should be sequential, so get the _1 one
        int underscore1 = partitioner.getPartition(new BulkIngestKey(new Text(tableName), new Key(formattedDay + "_1")), new Value(), NUM_REDUCE_TASKS);
        assertEquals(2, reducers.get(underscore1).size()); // _1 should have _0 and _1
        // remember _10 sorts before _2
        int underscore4 = partitioner.getPartition(new BulkIngestKey(new Text(tableName), new Key(formattedDay + "_4")), new Value(), NUM_REDUCE_TASKS);
        assertEquals(103, reducers.get(underscore4).size()); // _4 should have 2, 3, 4, 10-19, 20-29, 30-39,
                                                             // 100-109, 110-119, 120-129, 130-139, 140-149, 150-159, and 160-169
        int underscoreNext0 = partitioner.getPartition(new BulkIngestKey(new Text(tableName), new Key(formatDay(2) + "_0")), new Value(), NUM_REDUCE_TASKS);
        assertEquals(65, reducers.get(underscoreNext0).size()); // next row_0, should have 5, 6, 7, 8, 9, 40-49, 50-59, 60-69, 70-79, 80-89, 90-99
    }

    @Test
    public void testDifferentNumberShardPerDayCollapse() throws IOException {
        // Create SHARDS_PER_DAY splits for today, yesterday and the day before
        // Create 2 splits (_0 and _1) for 3 and 4 days ago.
        //
        // Now use the collapse strategy so days 3 and 4 only get split into 1 reducer
        // per existing split in Accumulo.
        //
        // This emulates a day having fewer splits for performance reasons because you don't expect
        // enough data to warrant the full compliment of splits and the overhead in the tserver of
        // tracking all those splits. The job will still generate data with row ids up to
        // SHARDS_PER_DAY, but simply write the same number of rfiles as splits.
        // See issues #45
        String tableName = "shard2";
        simulateDifferentNumberShardsPerDay("collapse", tableName);

        // 1 day ago should get SHARDS_PER_DAY partitions
        assertPartitionsForDay(partitioner, tableName, 1, SHARDS_PER_DAY);

        // 3 days ago should get 3 partitions, the _1, the _2 and the next days _0
        assertPartitionsForDay(partitioner, tableName, 3, 3);

        // now let's check they went in the right place
        Map<Integer,List<String>> reducers = new TreeMap<>();
        String formattedDay = formatDay(3);
        for (int i = 0; i < SHARDS_PER_DAY; i++) {
            String shardId = formattedDay + ("_" + i);
            int partition = partitioner.getPartition(new BulkIngestKey(new Text(tableName), new Key(shardId)), new Value(), NUM_REDUCE_TASKS);
            if (!reducers.containsKey(partition)) {
                reducers.put(partition, new ArrayList<String>());
            }
            reducers.get(partition).add(shardId);
        }
        assertEquals(3, reducers.size());
        // partitions should be sequential, so get the _1 one
        int underscore1 = partitioner.getPartition(new BulkIngestKey(new Text(tableName), new Key(formattedDay + "_1")), new Value(), NUM_REDUCE_TASKS);
        assertEquals(2, reducers.get(underscore1).size()); // _1 should have _0 and _1
        // remember _10 sorts before _2
        int underscore4 = partitioner.getPartition(new BulkIngestKey(new Text(tableName), new Key(formattedDay + "_4")), new Value(), NUM_REDUCE_TASKS);
        assertEquals(103, reducers.get(underscore4).size()); // _4 should have 2, 3, 4, 10-19, 20-29, 30-39,
                                                             // 100-109, 110-119, 120-129, 130-139, 140-149, 150-159, and 160-169
        int underscoreNext0 = partitioner.getPartition(new BulkIngestKey(new Text(tableName), new Key(formatDay(2) + "_0")), new Value(), NUM_REDUCE_TASKS);
        assertEquals(65, reducers.get(underscoreNext0).size()); // next row_0, should have 5, 6, 7, 8, 9, 40-49, 50-59, 60-69, 70-79, 80-89, 90-99
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public testDifferentNumberShardPerDayCollapse() : void from class datawave.ingest.mapreduce.partition.BalancedShardPartitionerTest


    @Test
    public void testPigeonHolesAreReal() throws Exception {
        ArrayList<String> allLocations = new ArrayList<>();
        ArrayList<String> locationsToUse = new ArrayList<>();
        for (int tserverNum = 1; tserverNum < TOTAL_TSERVERS; tserverNum++) {
            allLocations.add("" + tserverNum);
            if (tserverNum < (TOTAL_TSERVERS - SHARDS_PER_DAY) && tserverNum > (TOTAL_TSERVERS - (2 * SHARDS_PER_DAY))) {
                locationsToUse.add("" + tserverNum);
            }
        }
        Set<Integer> partitionsUsed = new HashSet<>();

        int collisions = 0;
        for (String location : locationsToUse) {
            byte[] bytes = location.getBytes();
            int hashCode = location.hashCode() & Integer.MAX_VALUE;
            int partition = (hashCode) % NUM_REDUCE_TASKS;
            if (partitionsUsed.contains(partition)) {
                collisions++;
            }
            partitionsUsed.add(partition);
        }
        Assert.assertEquals(42, collisions);
    }

    @Test
    public void testPigeonHolesAreReal() throws Exception {
        ArrayList<String> allLocations = new ArrayList<>();
        ArrayList<String> locationsToUse = new ArrayList<>();
        for (int tserverNum = 1; tserverNum < TOTAL_TSERVERS; tserverNum++) {
            allLocations.add("" + tserverNum);
            if (tserverNum < (TOTAL_TSERVERS - SHARDS_PER_DAY) && tserverNum > (TOTAL_TSERVERS - (2 * SHARDS_PER_DAY))) {
                locationsToUse.add("" + tserverNum);
            }
        }
        Set<Integer> partitionsUsed = new HashSet<Integer>();

        int collisions = 0;
        for (String location : locationsToUse) {
            byte[] bytes = location.getBytes();
            int hashCode = location.hashCode() & Integer.MAX_VALUE;
            int partition = (hashCode) % NUM_REDUCE_TASKS;
            if (partitionsUsed.contains(partition)) {
                collisions++;
            }
            partitionsUsed.add(partition);
        }
        Assert.assertEquals(42, collisions);
    }

Replace Generic With Diamond HashSet<Integer> with HashSet<> in method public testPigeonHolesAreReal() : void from class datawave.ingest.mapreduce.partition.TabletLocationHashPartitionerTest


    @Test
    public void testMerge() throws Exception {
        agg.reset();
        Set<Integer> shards = new HashSet<>();
        for (int i = 0; i <= 20; i++) {
            shards.add(i);
            shards.add(i * 3);
            shards.add(i * 5);
        }
        Collection<Value> values = Lists.newArrayList();
        for (Integer shard : shards) {
            BitSet bitSet = new BitSet(shard);
            bitSet.set(shard);
            Value val = new Value(bitSet.toByteArray());
            values.add(val);
        }
        Value result = agg.reduce(new Key("key"), values.iterator());

        BitSet bitSet = BitSet.valueOf(result.get());

        for (int i = 0; i <= (20 * 6); i++) {
            if (shards.contains(i)) {
                assertTrue(bitSet.get(i));
            } else {
                assertFalse(bitSet.get(i));
            }
        }
    }

    @Test
    public void testMerge() throws Exception {
        agg.reset();
        Set<Integer> shards = new HashSet<Integer>();
        for (int i = 0; i <= 20; i++) {
            shards.add(i);
            shards.add(i * 3);
            shards.add(i * 5);
        }
        Collection<Value> values = Lists.newArrayList();
        for (Integer shard : shards) {
            BitSet bitSet = new BitSet(shard);
            bitSet.set(shard);
            Value val = new Value(bitSet.toByteArray());
            values.add(val);
        }
        Value result = agg.reduce(new Key("key"), values.iterator());

        BitSet bitSet = BitSet.valueOf(result.get());

        for (int i = 0; i <= (20 * 6); i++) {
            if (shards.contains(i)) {
                assertTrue(bitSet.get(i));
            } else {
                assertFalse(bitSet.get(i));
            }
        }
    }

Replace Generic With Diamond HashSet<Integer> with HashSet<> in method public testMerge() : void from class datawave.ingest.table.aggregator.DateIndexDateAggregatorTest


    @Test
    public void testMerge2() throws Exception {
        agg.reset();
        Set<Integer> shards = new HashSet<>();
        for (int i = 0; i <= 20; i++) {
            shards.add(i);
            shards.add(i * 5);
            shards.add(i * 7);
        }
        Collection<Value> values = Lists.newArrayList();
        for (Integer shard : shards) {
            BitSet bitSet = new BitSet(shard);
            bitSet.set(shard);
            Value val = new Value(bitSet.toByteArray());
            values.add(val);
        }
        Value result = agg.reduce(new Key("key"), values.iterator());

        BitSet bitSet = BitSet.valueOf(result.get());

        for (int i = 0; i <= (20 * 8); i++) {
            if (shards.contains(i)) {
                assertTrue(bitSet.get(i));
            } else {
                assertFalse(bitSet.get(i));
            }
        }
    }

    @Test
    public void testMerge2() throws Exception {
        agg.reset();
        Set<Integer> shards = new HashSet<Integer>();
        for (int i = 0; i <= 20; i++) {
            shards.add(i);
            shards.add(i * 5);
            shards.add(i * 7);
        }
        Collection<Value> values = Lists.newArrayList();
        for (Integer shard : shards) {
            BitSet bitSet = new BitSet(shard);
            bitSet.set(shard);
            Value val = new Value(bitSet.toByteArray());
            values.add(val);
        }
        Value result = agg.reduce(new Key("key"), values.iterator());

        BitSet bitSet = BitSet.valueOf(result.get());

        for (int i = 0; i <= (20 * 8); i++) {
            if (shards.contains(i)) {
                assertTrue(bitSet.get(i));
            } else {
                assertFalse(bitSet.get(i));
            }
        }
    }

Replace Generic With Diamond HashSet<Integer> with HashSet<> in method public testMerge2() : void from class datawave.ingest.table.aggregator.DateIndexDateAggregatorTest


    @Test
    public void testLessThanMax() throws Exception {
        agg.reset();
        List<String> savedUUIDs = new ArrayList<>();
        Collection<Value> values = Lists.newArrayList();
        for (int i = 0; i < GlobalIndexUidAggregator.MAX - 1; i++) {
            Builder b = createNewUidList();
            b.setIGNORE(false);
            String uuid = UUID.randomUUID().toString();
            savedUUIDs.add(uuid);
            b.setCOUNT(1);
            b.addUID(uuid);
            Uid.List uidList = b.build();
            Value val = new Value(uidList.toByteArray());
            values.add(val);
        }
        Value result = agg.reduce(new Key("key"), values.iterator());
        Uid.List resultList = Uid.List.parseFrom(result.get());
        assertTrue(resultList.getIGNORE() == false);
        assertTrue(resultList.getUIDCount() == (GlobalIndexUidAggregator.MAX - 1));
        List<String> resultListUUIDs = resultList.getUIDList();
        for (String s : savedUUIDs)
            assertTrue(resultListUUIDs.contains(s));
    }

    @Test
    public void testLessThanMax() throws Exception {
        agg.reset();
        List<String> savedUUIDs = new ArrayList<String>();
        Collection<Value> values = Lists.newArrayList();
        for (int i = 0; i < GlobalIndexUidAggregator.MAX - 1; i++) {
            Builder b = createNewUidList();
            b.setIGNORE(false);
            String uuid = UUID.randomUUID().toString();
            savedUUIDs.add(uuid);
            b.setCOUNT(1);
            b.addUID(uuid);
            Uid.List uidList = b.build();
            Value val = new Value(uidList.toByteArray());
            values.add(val);
        }
        Value result = agg.reduce(new Key("key"), values.iterator());
        Uid.List resultList = Uid.List.parseFrom(result.get());
        assertTrue(resultList.getIGNORE() == false);
        assertTrue(resultList.getUIDCount() == (GlobalIndexUidAggregator.MAX - 1));
        List<String> resultListUUIDs = resultList.getUIDList();
        for (String s : savedUUIDs)
            assertTrue(resultListUUIDs.contains(s));
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public testLessThanMax() : void from class datawave.ingest.table.aggregator.GlobalIndexUidAggregatorTest


    @Test
    public void testEqualsMax() throws Exception {
        agg.reset();
        List<String> savedUUIDs = new ArrayList<>();
        Collection<Value> values = Lists.newArrayList();
        for (int i = 0; i < GlobalIndexUidAggregator.MAX; i++) {
            Builder b = createNewUidList();
            b.setIGNORE(false);
            String uuid = UUID.randomUUID().toString();
            savedUUIDs.add(uuid);
            b.setCOUNT(1);
            b.addUID(uuid);
            Uid.List uidList = b.build();
            Value val = new Value(uidList.toByteArray());
            values.add(val);
        }
        Value result = agg.reduce(new Key("key"), values.iterator());
        Uid.List resultList = Uid.List.parseFrom(result.get());
        assertFalse(resultList == null);
        assertTrue(resultList.getIGNORE() == false);
        assertTrue(resultList.getUIDCount() == (GlobalIndexUidAggregator.MAX));
        List<String> resultListUUIDs = resultList.getUIDList();
        for (String s : savedUUIDs)
            assertTrue(resultListUUIDs.contains(s));
    }

    @Test
    public void testEqualsMax() throws Exception {
        agg.reset();
        List<String> savedUUIDs = new ArrayList<String>();
        Collection<Value> values = Lists.newArrayList();
        for (int i = 0; i < GlobalIndexUidAggregator.MAX; i++) {
            Builder b = createNewUidList();
            b.setIGNORE(false);
            String uuid = UUID.randomUUID().toString();
            savedUUIDs.add(uuid);
            b.setCOUNT(1);
            b.addUID(uuid);
            Uid.List uidList = b.build();
            Value val = new Value(uidList.toByteArray());
            values.add(val);
        }
        Value result = agg.reduce(new Key("key"), values.iterator());
        Uid.List resultList = Uid.List.parseFrom(result.get());
        assertFalse(resultList == null);
        assertTrue(resultList.getIGNORE() == false);
        assertTrue(resultList.getUIDCount() == (GlobalIndexUidAggregator.MAX));
        List<String> resultListUUIDs = resultList.getUIDList();
        for (String s : savedUUIDs)
            assertTrue(resultListUUIDs.contains(s));
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public testEqualsMax() : void from class datawave.ingest.table.aggregator.GlobalIndexUidAggregatorTest


    @Test
    public void testMoreThanMax() throws Exception {
        agg.reset();
        List<String> savedUUIDs = new ArrayList<>();
        Collection<Value> values = Lists.newArrayList();
        for (int i = 0; i < GlobalIndexUidAggregator.MAX + 10; i++) {
            Builder b = createNewUidList();
            b.setIGNORE(false);
            String uuid = UUID.randomUUID().toString();
            savedUUIDs.add(uuid);
            b.setCOUNT(1);
            b.addUID(uuid);
            Uid.List uidList = b.build();
            Value val = new Value(uidList.toByteArray());
            values.add(val);
        }
        Value result = agg.reduce(new Key("key"), values.iterator());
        Uid.List resultList = Uid.List.parseFrom(result.get());
        assertTrue(resultList.getIGNORE() == true);
        assertTrue(resultList.getUIDCount() == 0);
        assertTrue(resultList.getCOUNT() == (GlobalIndexUidAggregator.MAX + 10));
    }

    @Test
    public void testMoreThanMax() throws Exception {
        agg.reset();
        List<String> savedUUIDs = new ArrayList<String>();
        Collection<Value> values = Lists.newArrayList();
        for (int i = 0; i < GlobalIndexUidAggregator.MAX + 10; i++) {
            Builder b = createNewUidList();
            b.setIGNORE(false);
            String uuid = UUID.randomUUID().toString();
            savedUUIDs.add(uuid);
            b.setCOUNT(1);
            b.addUID(uuid);
            Uid.List uidList = b.build();
            Value val = new Value(uidList.toByteArray());
            values.add(val);
        }
        Value result = agg.reduce(new Key("key"), values.iterator());
        Uid.List resultList = Uid.List.parseFrom(result.get());
        assertTrue(resultList.getIGNORE() == true);
        assertTrue(resultList.getUIDCount() == 0);
        assertTrue(resultList.getCOUNT() == (GlobalIndexUidAggregator.MAX + 10));
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public testMoreThanMax() : void from class datawave.ingest.table.aggregator.GlobalIndexUidAggregatorTest


    @Test
    public void testManyRemoval() throws Exception {
        agg.reset();
        List<String> savedUUIDs = new ArrayList<>();
        Collection<Value> values = Lists.newArrayList();
        for (int i = 0; i < GlobalIndexUidAggregator.MAX / 2; i++) {
            Builder b = createNewUidList();
            b.setIGNORE(false);
            String uuid = UUID.randomUUID().toString();
            savedUUIDs.add(uuid);

            b.setCOUNT(-1);
            b.addREMOVEDUID(uuid);
            Uid.List uidList = b.build();
            Value val = new Value(uidList.toByteArray());
            values.add(val);
        }
        int i = 0;

        for (int j = 0; j < 1; j++) {
            for (String uuid : savedUUIDs) {
                Builder b = createNewUidList();
                b.setIGNORE(false);
                if ((i % 2) == 0)
                    b.setCOUNT(1);
                else
                    b.setCOUNT(1);
                b.addUID(uuid);
                Uid.List uidList = b.build();
                Value val = new Value(uidList.toByteArray());
                values.add(val);
                i++;
            }
        }

        Value result = agg.reduce(new Key("key"), values.iterator());
        Uid.List resultList = Uid.List.parseFrom(result.get());
        assertEquals(resultList.getUIDCount(), 0);
        assertEquals(resultList.getCOUNT(), 0);

    }

    @Test
    public void testManyRemoval() throws Exception {
        agg.reset();
        List<String> savedUUIDs = new ArrayList<String>();
        Collection<Value> values = Lists.newArrayList();
        for (int i = 0; i < GlobalIndexUidAggregator.MAX / 2; i++) {
            Builder b = createNewUidList();
            b.setIGNORE(false);
            String uuid = UUID.randomUUID().toString();
            savedUUIDs.add(uuid);

            b.setCOUNT(-1);
            b.addREMOVEDUID(uuid);
            Uid.List uidList = b.build();
            Value val = new Value(uidList.toByteArray());
            values.add(val);
        }
        int i = 0;

        for (int j = 0; j < 1; j++) {
            for (String uuid : savedUUIDs) {
                Builder b = createNewUidList();
                b.setIGNORE(false);
                if ((i % 2) == 0)
                    b.setCOUNT(1);
                else
                    b.setCOUNT(1);
                b.addUID(uuid);
                Uid.List uidList = b.build();
                Value val = new Value(uidList.toByteArray());
                values.add(val);
                i++;
            }
        }

        Value result = agg.reduce(new Key("key"), values.iterator());
        Uid.List resultList = Uid.List.parseFrom(result.get());
        assertEquals(resultList.getUIDCount(), 0);
        assertEquals(resultList.getCOUNT(), 0);

    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public testManyRemoval() : void from class datawave.ingest.table.aggregator.GlobalIndexUidAggregatorTest


        public void exposeSetLocalityGroupConfigurationIfNecessary() throws AssertionError, AccumuloSecurityException, AccumuloException,
                        TableNotFoundException {

            Assert.assertNotNull("Unit Under Test not configured correctly - Parent missing.", this.parent);

            try {

                setLocalityGroupConfigurationCalled = false;
                areLocalityGroupsConfiguredCalled = false;
                overrideAreLocalityGroupsConfigured = true;
                resultsForAreLocalityGroupsConfigured = true;

                TableOperations tops = parent.mockUpTableOperations();
                Logger log = createMockLogger();
                Map<String,Set<Text>> newLocalityGroups = new HashMap<>();
                newLocalityGroups.put("hello, world!", new HashSet<>());

                this.setLocalityGroupConfigurationIfNecessary(AbstractTableConfigHelperTest.TABLE_NAME, newLocalityGroups, tops, log);

                Assert.assertTrue("SetLocalityGroupConfigurationIfNecessary failed to call areAggregatorsConfigured()", areLocalityGroupsConfiguredCalled);
                int actualSize = this.debugMessages.size();
                Assert.assertEquals("SetLocalityGroupConfigurationIfNecessary failed to set the expected number of debug Log Messages", 1, actualSize);
                this.debugMessages.clear();
                actualSize = this.infoMessages.size();
                Assert.assertEquals("SetLocalityGroupConfigurationIfNecessary set more then the expected number of info Log Messages", 0, actualSize);
                this.infoMessages.clear();

                areLocalityGroupsConfiguredCalled = false;
                overrideAreLocalityGroupsConfigured = true;
                resultsForAreLocalityGroupsConfigured = false;

                this.setLocalityGroupConfigurationIfNecessary(AbstractTableConfigHelperTest.TABLE_NAME, newLocalityGroups, tops, log);

                Assert.assertTrue("SetLocalityGroupConfigurationIfNecessary failed to call areAggregatorsConfigured()", areLocalityGroupsConfiguredCalled);
                actualSize = this.debugMessages.size();
                Assert.assertEquals("SetLocalityGroupConfigurationIfNecessary failed to set the expected number of debug Log Messages", 0, actualSize);
                this.debugMessages.clear();
                actualSize = this.infoMessages.size();
                Assert.assertEquals("SetLocalityGroupConfigurationIfNecessary set more then the expected number of info Log Messages", 2, actualSize);
                this.infoMessages.clear();

                newLocalityGroups.clear();
                Set<Text> values = new HashSet<>();

                values.add(new Text("hello, world!"));
                newLocalityGroups.put(AbstractTableConfigHelperTest.FIXED_KEYS[0], values);

                areLocalityGroupsConfiguredCalled = false;
                overrideAreLocalityGroupsConfigured = true;
                resultsForAreLocalityGroupsConfigured = false;

                this.setLocalityGroupConfigurationIfNecessary(AbstractTableConfigHelperTest.TABLE_NAME, newLocalityGroups, tops, log);

                Assert.assertTrue("SetLocalityGroupConfigurationIfNecessary failed to call areAggregatorsConfigured()", areLocalityGroupsConfiguredCalled);
                actualSize = this.debugMessages.size();
                Assert.assertEquals("SetLocalityGroupConfigurationIfNecessary failed to set the expected number of debug Log Messages", 0, actualSize);
                this.debugMessages.clear();
                actualSize = this.infoMessages.size();
                Assert.assertEquals("SetLocalityGroupConfigurationIfNecessary set more then the expected number of info Log Messages", 2, actualSize);
                this.infoMessages.clear();

            } finally {

                setLocalityGroupConfigurationCalled = false;
                areLocalityGroupsConfiguredCalled = false;
                overrideAreLocalityGroupsConfigured = false;
                resultsForAreLocalityGroupsConfigured = true;

            }

        }

        public void exposeSetLocalityGroupConfigurationIfNecessary() throws AssertionError, AccumuloSecurityException, AccumuloException,
                        TableNotFoundException {

            Assert.assertNotNull("Unit Under Test not configured correctly - Parent missing.", this.parent);

            try {

                setLocalityGroupConfigurationCalled = false;
                areLocalityGroupsConfiguredCalled = false;
                overrideAreLocalityGroupsConfigured = true;
                resultsForAreLocalityGroupsConfigured = true;

                TableOperations tops = parent.mockUpTableOperations();
                Logger log = createMockLogger();
                Map<String,Set<Text>> newLocalityGroups = new HashMap<>();
                newLocalityGroups.put("hello, world!", new HashSet<Text>());

                this.setLocalityGroupConfigurationIfNecessary(AbstractTableConfigHelperTest.TABLE_NAME, newLocalityGroups, tops, log);

                Assert.assertTrue("SetLocalityGroupConfigurationIfNecessary failed to call areAggregatorsConfigured()", areLocalityGroupsConfiguredCalled);
                int actualSize = this.debugMessages.size();
                Assert.assertEquals("SetLocalityGroupConfigurationIfNecessary failed to set the expected number of debug Log Messages", 1, actualSize);
                this.debugMessages.clear();
                actualSize = this.infoMessages.size();
                Assert.assertEquals("SetLocalityGroupConfigurationIfNecessary set more then the expected number of info Log Messages", 0, actualSize);
                this.infoMessages.clear();

                areLocalityGroupsConfiguredCalled = false;
                overrideAreLocalityGroupsConfigured = true;
                resultsForAreLocalityGroupsConfigured = false;

                this.setLocalityGroupConfigurationIfNecessary(AbstractTableConfigHelperTest.TABLE_NAME, newLocalityGroups, tops, log);

                Assert.assertTrue("SetLocalityGroupConfigurationIfNecessary failed to call areAggregatorsConfigured()", areLocalityGroupsConfiguredCalled);
                actualSize = this.debugMessages.size();
                Assert.assertEquals("SetLocalityGroupConfigurationIfNecessary failed to set the expected number of debug Log Messages", 0, actualSize);
                this.debugMessages.clear();
                actualSize = this.infoMessages.size();
                Assert.assertEquals("SetLocalityGroupConfigurationIfNecessary set more then the expected number of info Log Messages", 2, actualSize);
                this.infoMessages.clear();

                newLocalityGroups.clear();
                Set<Text> values = new HashSet<>();

                values.add(new Text("hello, world!"));
                newLocalityGroups.put(AbstractTableConfigHelperTest.FIXED_KEYS[0], values);

                areLocalityGroupsConfiguredCalled = false;
                overrideAreLocalityGroupsConfigured = true;
                resultsForAreLocalityGroupsConfigured = false;

                this.setLocalityGroupConfigurationIfNecessary(AbstractTableConfigHelperTest.TABLE_NAME, newLocalityGroups, tops, log);

                Assert.assertTrue("SetLocalityGroupConfigurationIfNecessary failed to call areAggregatorsConfigured()", areLocalityGroupsConfiguredCalled);
                actualSize = this.debugMessages.size();
                Assert.assertEquals("SetLocalityGroupConfigurationIfNecessary failed to set the expected number of debug Log Messages", 0, actualSize);
                this.debugMessages.clear();
                actualSize = this.infoMessages.size();
                Assert.assertEquals("SetLocalityGroupConfigurationIfNecessary set more then the expected number of info Log Messages", 2, actualSize);
                this.infoMessages.clear();

            } finally {

                setLocalityGroupConfigurationCalled = false;
                areLocalityGroupsConfiguredCalled = false;
                overrideAreLocalityGroupsConfigured = false;
                resultsForAreLocalityGroupsConfigured = true;

            }

        }

Replace Generic With Diamond HashSet<Text> with HashSet<> in method public exposeSetLocalityGroupConfigurationIfNecessary() : void from class datawave.ingest.table.config.AbstractTableConfigHelperTest.TestAbstractTableConfigHelperImpl


    public static void processEvent(DataTypeHandler<Text> handler, ExtendedDataTypeHandler<Text,BulkIngestKey,Value> edgeHandler, RawRecordContainer event,
                    int expectedShardKeys, int expectedShardIndexKeys, int expectedShardReverseIndexKeys, int expectedEdgeKeys, boolean printKeysOnlyOnFail) {

        Assert.assertNotNull("Event was null.", event);
        Multimap<String,NormalizedContentInterface> eventFields = handler.getHelper(event.getDataType()).getEventFields(event);
        VirtualIngest vHelper = (VirtualIngest) handler.getHelper(event.getDataType());
        Multimap<String,NormalizedContentInterface> virtualFields = vHelper.getVirtualFields(eventFields);
        for (Map.Entry<String,NormalizedContentInterface> v : virtualFields.entries()) {
            eventFields.put(v.getKey(), v.getValue());
        }
        if (vHelper instanceof CompositeIngest) {
            CompositeIngest compIngest = (CompositeIngest) vHelper;
            Multimap<String,NormalizedContentInterface> compositeFields = compIngest.getCompositeFields(eventFields);
            for (String fieldName : compositeFields.keySet()) {
                // if this is an overloaded event field, we are replacing the existing data
                if (compIngest.isOverloadedCompositeField(fieldName))
                    eventFields.removeAll(fieldName);
                eventFields.putAll(fieldName, compositeFields.get(fieldName));
            }
        }
        Multimap<BulkIngestKey,Value> results = handler.processBulk(new Text(), event, eventFields, new MockStatusReporter());
        Set<Key> shardKeys = new HashSet<>();
        Set<Key> shardIndexKeys = new HashSet<>();
        Set<Key> shardReverseIndexKeys = new HashSet<>();
        Set<Key> edgeKeys = new HashSet<>();
        Map<Text,Integer> countMap = Maps.newHashMap();

        for (BulkIngestKey k : results.keySet()) {
            Text tableName = k.getTableName();
            if (countMap.containsKey(tableName)) {
                countMap.put(tableName, countMap.get(tableName) + 1);
            } else {
                countMap.put(tableName, 1);
            }
        }

        for (Map.Entry<BulkIngestKey,Value> e : results.entries()) {

            BulkIngestKey bik = e.getKey();
            if (log.isDebugEnabled() && isDocumentKey(bik.getKey())) {
                log.debug("Found Document Key: " + bik.getKey());
                log.debug("value:\n" + e.getValue());
            }

            if (bik.getTableName().equals(shardTableName)) {
                shardKeys.add(bik.getKey());
            } else if (bik.getTableName().equals(shardIndexTableName)) {
                shardIndexKeys.add(bik.getKey());
            } else if (bik.getTableName().equals(shardReverseIndexTableName)) {
                shardReverseIndexKeys.add(bik.getKey());
            } else {
                Assert.fail("unknown table: " + bik.getTableName() + " key: " + bik.getKey());
            }

        }

        // Process edges
        countMap.put(edgeTableName, 0);
        if (null != edgeHandler) {
            MyCachingContextWriter contextWriter = new MyCachingContextWriter();
            StandaloneTaskAttemptContext<Text,RawRecordContainerImpl,BulkIngestKey,Value> ctx = new StandaloneTaskAttemptContext<>(
                            ((RawRecordContainerImpl) event).getConf(), new StandaloneStatusReporter());

            try {
                contextWriter.setup(ctx.getConfiguration(), false);
                edgeHandler.process(null, event, eventFields, ctx, contextWriter);
                contextWriter.commit(ctx);
                for (Map.Entry<BulkIngestKey,Value> entry : contextWriter.getCache().entries()) {
                    if (entry.getKey().getTableName().equals(edgeTableName)) {
                        edgeKeys.add(entry.getKey().getKey());
                    }
                    if (countMap.containsKey(entry.getKey().getTableName())) {
                        countMap.put(entry.getKey().getTableName(), countMap.get(entry.getKey().getTableName()) + 1);
                    } else {
                        countMap.put(entry.getKey().getTableName(), 1);
                    }
                }
            } catch (Throwable t) {
                log.error("Error during edge processing", t);
                throw new RuntimeException(t);
            }
        }

        Set<String> keyPrint = new TreeSet<>();

        for (Key k : shardKeys) {
            keyPrint.add("shard key: " + k.getRow() + " ::: " + k.getColumnFamily().toString().replaceAll(NB, "%00;") + " ::: "
                            + k.getColumnQualifier().toString().replaceAll(NB, "%00;") + " ::: " + k.getColumnVisibility() + " ::: " + k.getTimestamp() + "\n");
        }

        // check index keys
        for (Key k : shardIndexKeys) {
            keyPrint.add("shardIndex key: " + k.getRow() + " ::: " + k.getColumnFamily().toString().replaceAll(NB, "%00;") + " ::: "
                            + k.getColumnQualifier().toString().replaceAll(NB, "%00;") + " ::: " + k.getColumnVisibility() + " ::: " + k.getTimestamp() + "\n");
        }

        // check reverse index keys
        for (Key k : shardReverseIndexKeys) {
            keyPrint.add("reverseShardIndex key: " + k.getRow() + " ::: " + k.getColumnFamily().toString().replaceAll(NB, "%00;") + " ::: "
                            + k.getColumnQualifier().toString().replaceAll(NB, "%00;") + " ::: " + k.getColumnVisibility() + " ::: " + k.getTimestamp() + "\n");
        }

        // check edge keys
        for (Key k : edgeKeys) {
            keyPrint.add("edge key: " + k.getRow().toString().replaceAll(NB, "%00;") + " ::: " + k.getColumnFamily().toString().replaceAll(NB, "%00;")
                            + " ::: " + k.getColumnQualifier().toString().replaceAll(NB, "%00;") + " ::: " + k.getColumnVisibility() + " ::: "
                            + k.getTimestamp() + "\n");
        }

        try {
            if (!printKeysOnlyOnFail) {
                for (String keyString : keyPrint) {
                    log.info(keyString.trim());
                }
            }
            if (expectedShardKeys > 0)
                Assert.assertTrue(countMap.get(shardTableName) == expectedShardKeys);
            if (expectedShardIndexKeys > 0)
                Assert.assertTrue(countMap.get(shardIndexTableName) == expectedShardIndexKeys);
            if (expectedShardReverseIndexKeys > 0)
                Assert.assertTrue(countMap.get(shardReverseIndexTableName) == expectedShardReverseIndexKeys);
            if (expectedEdgeKeys > 0)
                Assert.assertTrue(countMap.get(edgeTableName) == expectedEdgeKeys);
        } catch (AssertionError ae) {
            if (printKeysOnlyOnFail) {
                for (String keyString : keyPrint) {
                    log.info(keyString.trim());
                }
            }
            Assert.fail(String.format("Expected: %s shard, %s index, %s reverse index, and %s edge keys.\nFound: %s, %s, %s, and %s respectively",
                            expectedShardKeys, expectedShardIndexKeys, expectedShardReverseIndexKeys, expectedEdgeKeys, countMap.get(shardTableName),
                            countMap.get(shardIndexTableName), countMap.get(shardReverseIndexTableName), countMap.get(edgeTableName)));
        }
    }

    public static void processEvent(DataTypeHandler<Text> handler, ExtendedDataTypeHandler<Text,BulkIngestKey,Value> edgeHandler, RawRecordContainer event,
                    int expectedShardKeys, int expectedShardIndexKeys, int expectedShardReverseIndexKeys, int expectedEdgeKeys, boolean printKeysOnlyOnFail) {

        Assert.assertNotNull("Event was null.", event);
        Multimap<String,NormalizedContentInterface> eventFields = handler.getHelper(event.getDataType()).getEventFields(event);
        VirtualIngest vHelper = (VirtualIngest) handler.getHelper(event.getDataType());
        Multimap<String,NormalizedContentInterface> virtualFields = vHelper.getVirtualFields(eventFields);
        for (Map.Entry<String,NormalizedContentInterface> v : virtualFields.entries()) {
            eventFields.put(v.getKey(), v.getValue());
        }
        if (vHelper instanceof CompositeIngest) {
            CompositeIngest compIngest = (CompositeIngest) vHelper;
            Multimap<String,NormalizedContentInterface> compositeFields = compIngest.getCompositeFields(eventFields);
            for (String fieldName : compositeFields.keySet()) {
                // if this is an overloaded event field, we are replacing the existing data
                if (compIngest.isOverloadedCompositeField(fieldName))
                    eventFields.removeAll(fieldName);
                eventFields.putAll(fieldName, compositeFields.get(fieldName));
            }
        }
        Multimap<BulkIngestKey,Value> results = handler.processBulk(new Text(), event, eventFields, new MockStatusReporter());
        Set<Key> shardKeys = new HashSet<>();
        Set<Key> shardIndexKeys = new HashSet<>();
        Set<Key> shardReverseIndexKeys = new HashSet<>();
        Set<Key> edgeKeys = new HashSet<>();
        Map<Text,Integer> countMap = Maps.newHashMap();

        for (BulkIngestKey k : results.keySet()) {
            Text tableName = k.getTableName();
            if (countMap.containsKey(tableName)) {
                countMap.put(tableName, countMap.get(tableName) + 1);
            } else {
                countMap.put(tableName, 1);
            }
        }

        for (Map.Entry<BulkIngestKey,Value> e : results.entries()) {

            BulkIngestKey bik = e.getKey();
            if (log.isDebugEnabled() && isDocumentKey(bik.getKey())) {
                log.debug("Found Document Key: " + bik.getKey());
                log.debug("value:\n" + e.getValue());
            }

            if (bik.getTableName().equals(shardTableName)) {
                shardKeys.add(bik.getKey());
            } else if (bik.getTableName().equals(shardIndexTableName)) {
                shardIndexKeys.add(bik.getKey());
            } else if (bik.getTableName().equals(shardReverseIndexTableName)) {
                shardReverseIndexKeys.add(bik.getKey());
            } else {
                Assert.fail("unknown table: " + bik.getTableName() + " key: " + bik.getKey());
            }

        }

        // Process edges
        countMap.put(edgeTableName, 0);
        if (null != edgeHandler) {
            MyCachingContextWriter contextWriter = new MyCachingContextWriter();
            StandaloneTaskAttemptContext<Text,RawRecordContainerImpl,BulkIngestKey,Value> ctx = new StandaloneTaskAttemptContext<>(
                            ((RawRecordContainerImpl) event).getConf(), new StandaloneStatusReporter());

            try {
                contextWriter.setup(ctx.getConfiguration(), false);
                edgeHandler.process(null, event, eventFields, ctx, contextWriter);
                contextWriter.commit(ctx);
                for (Map.Entry<BulkIngestKey,Value> entry : contextWriter.getCache().entries()) {
                    if (entry.getKey().getTableName().equals(edgeTableName)) {
                        edgeKeys.add(entry.getKey().getKey());
                    }
                    if (countMap.containsKey(entry.getKey().getTableName())) {
                        countMap.put(entry.getKey().getTableName(), countMap.get(entry.getKey().getTableName()) + 1);
                    } else {
                        countMap.put(entry.getKey().getTableName(), 1);
                    }
                }
            } catch (Throwable t) {
                log.error("Error during edge processing", t);
                throw new RuntimeException(t);
            }
        }

        Set<String> keyPrint = new TreeSet<String>();

        for (Key k : shardKeys) {
            keyPrint.add("shard key: " + k.getRow() + " ::: " + k.getColumnFamily().toString().replaceAll(NB, "%00;") + " ::: "
                            + k.getColumnQualifier().toString().replaceAll(NB, "%00;") + " ::: " + k.getColumnVisibility() + " ::: " + k.getTimestamp() + "\n");
        }

        // check index keys
        for (Key k : shardIndexKeys) {
            keyPrint.add("shardIndex key: " + k.getRow() + " ::: " + k.getColumnFamily().toString().replaceAll(NB, "%00;") + " ::: "
                            + k.getColumnQualifier().toString().replaceAll(NB, "%00;") + " ::: " + k.getColumnVisibility() + " ::: " + k.getTimestamp() + "\n");
        }

        // check reverse index keys
        for (Key k : shardReverseIndexKeys) {
            keyPrint.add("reverseShardIndex key: " + k.getRow() + " ::: " + k.getColumnFamily().toString().replaceAll(NB, "%00;") + " ::: "
                            + k.getColumnQualifier().toString().replaceAll(NB, "%00;") + " ::: " + k.getColumnVisibility() + " ::: " + k.getTimestamp() + "\n");
        }

        // check edge keys
        for (Key k : edgeKeys) {
            keyPrint.add("edge key: " + k.getRow().toString().replaceAll(NB, "%00;") + " ::: " + k.getColumnFamily().toString().replaceAll(NB, "%00;")
                            + " ::: " + k.getColumnQualifier().toString().replaceAll(NB, "%00;") + " ::: " + k.getColumnVisibility() + " ::: "
                            + k.getTimestamp() + "\n");
        }

        try {
            if (!printKeysOnlyOnFail) {
                for (String keyString : keyPrint) {
                    log.info(keyString.trim());
                }
            }
            if (expectedShardKeys > 0)
                Assert.assertTrue(countMap.get(shardTableName) == expectedShardKeys);
            if (expectedShardIndexKeys > 0)
                Assert.assertTrue(countMap.get(shardIndexTableName) == expectedShardIndexKeys);
            if (expectedShardReverseIndexKeys > 0)
                Assert.assertTrue(countMap.get(shardReverseIndexTableName) == expectedShardReverseIndexKeys);
            if (expectedEdgeKeys > 0)
                Assert.assertTrue(countMap.get(edgeTableName) == expectedEdgeKeys);
        } catch (AssertionError ae) {
            if (printKeysOnlyOnFail) {
                for (String keyString : keyPrint) {
                    log.info(keyString.trim());
                }
            }
            Assert.fail(String.format("Expected: %s shard, %s index, %s reverse index, and %s edge keys.\nFound: %s, %s, %s, and %s respectively",
                            expectedShardKeys, expectedShardIndexKeys, expectedShardReverseIndexKeys, expectedEdgeKeys, countMap.get(shardTableName),
                            countMap.get(shardIndexTableName), countMap.get(shardReverseIndexTableName), countMap.get(edgeTableName)));
        }
    }

Replace Generic With Diamond TreeSet<String> with TreeSet<> in method public processEvent(handler DataTypeHandler<Text>, edgeHandler ExtendedDataTypeHandler<Text,BulkIngestKey,Value>, event RawRecordContainer, expectedShardKeys int, expectedShardIndexKeys int, expectedShardReverseIndexKeys int, expectedEdgeKeys int, printKeysOnlyOnFail boolean) : void from class datawave.ingest.csv.mr.handler.ColumnBasedHandlerTestUtil


    @Test
    public void testCsv01() throws Exception {
        log.debug("---testCsv01---");
        conf.addResource(ClassLoader.getSystemResource("config/ingest/all-config.xml"));
        conf.addResource(ClassLoader.getSystemResource("config/ingest/csv-ingest-config.xml"));
        conf.addResource(ClassLoader.getSystemResource("config/ingest/edge-ingest-config.xml"));
        conf.addResource(ClassLoader.getSystemResource("config/ingest/metadata-config.xml"));
        TypeRegistry.getInstance(conf);
        ExtendedCSVHelper helper = new ExtendedCSVHelper();
        helper.setup(conf);

        // Set up the IngestHelper
        ExtendedCSVIngestHelper ingestHelper = new ExtendedCSVIngestHelper();
        ingestHelper.setup(conf);

        // Set up the ColumnBasedHandler
        TaskAttemptContext context = new TaskAttemptContextImpl(conf, new TaskAttemptID());
        ContentCSVColumnBasedHandler<Text> csvHandler = new ContentCSVColumnBasedHandler<>();
        csvHandler.setup(context);

        // Set up the Reader
        CSVRecordReader reader = getCSVRecordReader("/input/my.csv");

        // ----------------------------------------------------------------------
        // EVENT 1
        Assert.assertTrue("First Record did not read properly?", reader.nextKeyValue());
        RawRecordContainer event = reader.getEvent();
        Assert.assertNotNull("Event 1 was null.", event);
        Assert.assertTrue("Event 1 has parsing errors", event.getErrors().isEmpty());

        // Set up the edge
        ProtobufEdgeDataTypeHandler<Text,BulkIngestKey,Value> edgeHandler = new ProtobufEdgeDataTypeHandler<>();
        edgeHandler.setup(context);

        ColumnBasedHandlerTestUtil.processEvent(csvHandler, edgeHandler, event, 73, 29, 25, 4, true);

        // ----------------------------------------------------------------------
        // EVENT 2
        Assert.assertTrue("Second Record did not read properly?", reader.nextKeyValue());
        event = reader.getEvent();
        Assert.assertNotNull("Event 2 was null.", event);
        Assert.assertTrue("Event 2 has parsing errors", event.getErrors().isEmpty());

        edgeHandler = new ProtobufEdgeDataTypeHandler<>();
        edgeHandler.setup(context);

        ColumnBasedHandlerTestUtil.processEvent(csvHandler, edgeHandler, event, 77, 31, 24, 4, true);

        reader.close();
    }

    @Test
    public void testCsv01() throws Exception {
        log.debug("---testCsv01---");
        conf.addResource(ClassLoader.getSystemResource("config/ingest/all-config.xml"));
        conf.addResource(ClassLoader.getSystemResource("config/ingest/csv-ingest-config.xml"));
        conf.addResource(ClassLoader.getSystemResource("config/ingest/edge-ingest-config.xml"));
        conf.addResource(ClassLoader.getSystemResource("config/ingest/metadata-config.xml"));
        TypeRegistry.getInstance(conf);
        ExtendedCSVHelper helper = new ExtendedCSVHelper();
        helper.setup(conf);

        // Set up the IngestHelper
        ExtendedCSVIngestHelper ingestHelper = new ExtendedCSVIngestHelper();
        ingestHelper.setup(conf);

        // Set up the ColumnBasedHandler
        TaskAttemptContext context = new TaskAttemptContextImpl(conf, new TaskAttemptID());
        ContentCSVColumnBasedHandler<Text> csvHandler = new ContentCSVColumnBasedHandler<Text>();
        csvHandler.setup(context);

        // Set up the Reader
        CSVRecordReader reader = getCSVRecordReader("/input/my.csv");

        // ----------------------------------------------------------------------
        // EVENT 1
        Assert.assertTrue("First Record did not read properly?", reader.nextKeyValue());
        RawRecordContainer event = reader.getEvent();
        Assert.assertNotNull("Event 1 was null.", event);
        Assert.assertTrue("Event 1 has parsing errors", event.getErrors().isEmpty());

        // Set up the edge
        ProtobufEdgeDataTypeHandler<Text,BulkIngestKey,Value> edgeHandler = new ProtobufEdgeDataTypeHandler<>();
        edgeHandler.setup(context);

        ColumnBasedHandlerTestUtil.processEvent(csvHandler, edgeHandler, event, 73, 29, 25, 4, true);

        // ----------------------------------------------------------------------
        // EVENT 2
        Assert.assertTrue("Second Record did not read properly?", reader.nextKeyValue());
        event = reader.getEvent();
        Assert.assertNotNull("Event 2 was null.", event);
        Assert.assertTrue("Event 2 has parsing errors", event.getErrors().isEmpty());

        edgeHandler = new ProtobufEdgeDataTypeHandler<>();
        edgeHandler.setup(context);

        ColumnBasedHandlerTestUtil.processEvent(csvHandler, edgeHandler, event, 77, 31, 24, 4, true);

        reader.close();
    }

Replace Generic With Diamond ContentCSVColumnBasedHandler<Text> with ContentCSVColumnBasedHandler<> in method public testCsv01() : void from class datawave.ingest.csv.mr.handler.ContentCSVIndexingColumnBasedHandlerTest