class FruIdEventsHelperUtil {

    public static List<Event> addFruIDtoStorageControllerEvents( List<Event> aggregatedEvents,
                                                                 List<StorageController> storageControllerList )
    {

        List<Event> events = new ArrayList<Event>();
        StorageController storageController = new StorageController();

        try
        {
            for ( int i = 0; i < aggregatedEvents.size(); i++ )
            {
                Event event = aggregatedEvents.get( i );
                Map<EventComponent, String> eventComponentIdentifier = event.getHeader().getComponentIdentifier();
                Map<String, String> eventBody = event.getBody().getData();
                String componentId = eventComponentIdentifier.get( EventComponent.STORAGE_CONTROLLER );

                for ( int j = 0; j < storageControllerList.size(); j++ )
                {
                    String deviceNameProduct = storageControllerList.get( j ).getDeviceName() + " "
                        + storageControllerList.get( j ).getComponentIdentifier().getProduct();
                    if ( componentId.equals( deviceNameProduct ) )
                    {
                        storageController = storageControllerList.get( j );
                        eventBody.put( "fruID", storageController.getFruId() );
                        break;
                    }
                }
                events.add( event );
            }
            return events;
        }
        catch ( Exception e )
        {
            logger.error( "HMS aggregator error in adding Fru ID to Storage Controller Events", e );
        }

        return null;
    }

}