Convert the data to a list (if necessary).

@param data the data to convert to a list
@return the data converted to a list
171873
private List<?> convertDataToList(final Object data) {
		if (data == null) {
			return null;
		} else if (data instanceof List) {
			return (List<?>) data;
		} else if (data instanceof Object[]) {
			return Arrays.asList((Object[]) data);
		} else {
			return Arrays.asList(new Object[]{data});
		}
	}
1111270
@NonNull
    @Override
    public List<Object> toList() {
        synchronized (lock) {
            final int count = (int) internalArray.count();
            final List<Object> result = new ArrayList<>(count);
            for (int index = 0; index < count; index++) {
                result.add(Fleece.toObject(getMValue(internalArray, index).asNative(internalArray)));
            }
            return result;
        }
    }
1215029
public static <T> List<T> arrayToList(T[] array) {
        List<T> list = null;
        if (array != null) {
            list = new ArrayList<>();
            for (T e : array) {
                list.add(e);
            }
        }
        return list;
    }
341088
private Data[] convertToData(T[] items) {
        if (items == null || items.length == 0) {
            return new Data[0];
        }
        if (items[0] instanceof Data) {
            return (Data[]) items;
        }
        final Data[] ret = new Data[items.length];
        for (int i = 0; i < items.length; i++) {
            ret[i] = convertToData(items[i]);
        }
        return ret;
    }
1245123
protected static Set<Tag> stringToTags(String data) {
        Set<Tag> tags = new HashSet<>();
        String[] split = data.split("\r");
        for (String s : split) {
            if (s.indexOf(Tag.KEY_VALUE_SEPARATOR) > -1) {
                String[] keyValue = s.split(String.valueOf(Tag.KEY_VALUE_SEPARATOR));
                if (keyValue.length == 2) {
                    tags.add(new Tag(keyValue[0], keyValue[1]));
                }
            }
        }
        return tags;
    }
33450
public FgExampleList getData(LogLinearXYData data) {
        IntObjectBimap<String> alphabet = data.getFeatAlphabet();
        List<LogLinearExample> exList = data.getData();    
        if (this.alphabet == null) {
            this.alphabet = alphabet;
            this.stateNames = getStateNames(exList, data.getYAlphabet());
        }
        
        if (prm.cacheExamples) {
            FgExampleMemoryStore store = new FgExampleMemoryStore();
            for (final LogLinearExample desc : exList) {
                LFgExample ex = getFgExample(desc);
                store.add(ex);
            }
            return store;
        } else {
            return new FgExampleList() {
                @Override
                public LFgExample get(int i) {
                    return getFgExample(exList.get(i));
                }
                @Override
                public int size() {
                    return exList.size();
                }                
            };
        }
    }
266570
def serialize_list(self, data):
        
        if data is None:
            return ''

        # Check for a ``Data``-like object. We should assume ``True`` (all
        # data gets prepared) unless it's explicitly marked as not.
        if not getattr(data, 'should_prepare', True):
            prepped_data = data.value
        else:
            prepped_data = [self.prepare(item) for item in data]

        final_data = self.wrap_list_response(prepped_data)
        return self.serializer.serialize(final_data)
41070
@SuppressWarnings("unchecked")
    protected static <T> Map<String, T> cloneData(Map<String, T> data) {
        return SerializationUtils.fromByteArray(SerializationUtils.toByteArray(data), Map.class);
    }
469689
static final Map<String, Object> previousAndCurrentToDelta(List<Map<String, Object>> data) {
        if (data.size() == 2) {
            Map<String, Object> previous = data.get(0);
            Map<String, Object> current = data.get(1);
            return previousAndCurrentToDelta(previous, current);
        } else {
            throw new IllegalArgumentException("Must be list of 2 items");
        }

    }
989169
public <T> List<T> dataToTypedList(Class<T> type) {
        return Reflection.toTypedList(data, type);
    }
1150539
public static List toList(Object o, List defaultValue) {
	return toList(o, false, defaultValue);
    }
213400
public <T extends Comparable<? super T>> List<T> sort (Collection<T> data)
    {
        return sort(new ArrayList<T>(data));
    }
920260
public static List<Example> asList( Example example )
    {
        if (example == null) return new ArrayList<Example>();

        List<Example> all = new ArrayList<Example>();
        for (Example each : example)
        {
            all.add( each );
        }
        return all;
    }
1333231
@Override
	public List<ITreeNode<T>> toList()
	{
		final List<ITreeNode<T>> list = new ArrayList<>();
		traverse(this, list);
		return list;
	}
1354789
public Iterable<List<String>> toLists() {
    checkState(!isClosed, WORKBOOK_CLOSED);
    Iterable<List<String>> listsIterable = Iterables.transform(sheet, item -> {
      return rowToList(item);
    });
    return hasHeader ? Iterables.skip(listsIterable, 1) : listsIterable;
  }
400548
protected final List<?> list(Object... datas) {
    List<Object> items = CollectUtils.newArrayList(datas.length);
    for (Object obj : datas) {
      if (obj instanceof Class<?>) {
        items.add(buildInnerReference((Class<?>) obj));
      } else {
        items.add(obj);
      }
    }
    return items;
  }
830205
public final void setData(@Nullable Data<?> data) {
        setDatas(data != null ? singleton(data) : Collections.<Data<?>>emptyList());
    }