gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/io/GemFireIO.java
@SuppressWarnings("unchecked")
	public static <T> void flatten(Collection<Object> input,
			Collection<Object> flattenOutput)
	throws Exception
	{
		if (input == null || input.isEmpty() || flattenOutput == null)
			return;

		for (Object inputObj : input)
		{
			if(inputObj instanceof Exception )
				throw (Exception)inputObj;
			
			if(inputObj == null)
				continue;
			
			if(inputObj instanceof Collection)
				flatten((Collection<Object>)inputObj,flattenOutput);
			else
				flattenOutput.add(inputObj);

		}

	}
@SuppressWarnings("unchecked")
	public static <T> void flatten(Collection<Object> input,
			Collection<Object> flattenOutput)
	throws Exception
	{
		if (input == null || input.isEmpty() || flattenOutput == null)
			return;

		for (Object inputObj : input)
		{
			if(inputObj instanceof Exception )
				throw (Exception)inputObj;
			
			if(inputObj == null)
				continue;
			
			if(inputObj instanceof Collection)
				flatten((Collection<Object>)inputObj,flattenOutput);
			else
				flattenOutput.add(inputObj);

		}

	}
Used to flatten results from multiple servers
@param input the unflatten input
@param flattenOutput the flatten results
@param <T> the return type of collection objects
@throws Exception if an any input collection items are exceptions