/*******************************************************************************
 * Copyright (C) 2016 Black Duck Software, Inc.
 * http://www.blackducksoftware.com/
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 *******************************************************************************/
package com.blackducksoftware.integration.hub.notification.processor;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.SortedSet;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.blackducksoftware.integration.hub.dataservice.notification.item.NotificationContentItem;
import com.blackducksoftware.integration.hub.notification.processor.event.NotificationEvent;

public abstract class NotificationProcessor<T> {
    private final Logger logger = LoggerFactory.getLogger(MockProcessor.class);

    private final Map<Class<?>, NotificationSubProcessor<?>> processorMap = new HashMap<>();

    private final List<MapProcessorCache<?>> cacheList = new ArrayList<>();

    public T process(final SortedSet<NotificationContentItem> notifications) {
        createEvents(notifications);
        final Collection<NotificationEvent<?>> events = collectEvents();
        return processEvents(events);
    }

    private void createEvents(final SortedSet<NotificationContentItem> notifications) {
        for (final NotificationContentItem item : notifications) {
            final Class<?> key = item.getClass();
            if (!processorMap.containsKey(key)) {
                logger.error("Could not find converter for notification: {}", item);
            } else {
                final NotificationSubProcessor<?> processor = processorMap.get(key);
                processor.process(item);
            }
        }
    }

    public abstract T processEvents(Collection<NotificationEvent<?>> eventCollection);

    private Collection<NotificationEvent<?>> collectEvents() {
        final Collection<NotificationEvent<?>> eventList = new LinkedList<>();
        for (final MapProcessorCache<?> processor : cacheList) {
            eventList.addAll(processor.getEvents());
        }
        return eventList;
    }

    public Map<Class<?>, NotificationSubProcessor<?>> getProcessorMap() {
        return processorMap;
    }

    public List<MapProcessorCache<?>> getCacheList() {
        return cacheList;
    }
}

@@ -1300,66 +1300,8 @@
 t;%0A%0A
-import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0A
 impo
@@ -1542,88 +1542,8 @@
 T%3E %7B
-%0A    private final Logger logger = LoggerFactory.getLogger(MockProcessor.class);
 %0A%0A  
@@ -2170,9 +2170,8 @@
 if (
-!
 proc
@@ -2203,114 +2203,8 @@
 ) %7B%0A
-                logger.error(%22Could not find converter for notification: %7B%7D%22, item);%0A            %7D else %7B%0A
     

Fix comiple error