private static ComplexMultiValue GenerateSimilarComplexMultiValue(IRandomNumberGenerator random, ComplexMultiValue currentInstance) { ComplexMultiValue instance = ((ComplexMultiValue)currentInstance.DeepCopy()); if (instance.Count != 0) { ComplexInstance val = instance.First(); int numItems = random.NextFromRange(1, 3); var newItems = Enumerable.Range(0, numItems).Select(x => GenerateSimilarComplexInstance(random, val)); instance = new ComplexMultiValue(val.FullTypeName, false, newItems.ToArray()); } return(instance); }