/*
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2015  
 */
package com.ibm.streamsx.topology.internal.logic;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Stack;
import java.util.Vector;

import com.ibm.streamsx.topology.function.Supplier;

public final class Constants<T> implements Supplier<Iterable<T>> {
    private static final long serialVersionUID = 1L;
    
    private final List<T> data;
    
    public Constants(List<T> data) {
        List<T> copiedData;
        
        if (data.isEmpty())
            copiedData = data;
        if (data instanceof ArrayList || data instanceof LinkedList
                || data instanceof Stack || data instanceof Vector)
            copiedData = data;
        else {
            copiedData = new ArrayList<>(data.size());
            copiedData.addAll(data);
        }      
        
        this.data = copiedData;
    }
    @Override
    public Iterable<T> get() {
        return data;
    }
}
@@ -779,16 +779,188 @@
  else %7B%0A
+            // Copy the data in case the list is not serializable.%0A            // and to ensure the contents are in the stream in%0A            // case it is a %22smart%22 list.%0A
         

Add comment about the copying of a list in Constants