private static IIonValue FilterHashLog(IIonValue actualHashLog, IIonValue expectedHashLog) { HashSet <string> methodCalls = new HashSet <string>(); IEnumerator <IIonValue> enumerator = expectedHashLog.GetEnumerator(); while (enumerator.MoveNext()) { IIonValue v = enumerator.Current; foreach (SymbolToken annotation in v.GetTypeAnnotationSymbols()) { methodCalls.Add(annotation.Text); } } IValueFactory valueFactory = new ValueFactory(); IIonValue result = valueFactory.NewEmptySexp(); if (methodCalls.Count == 1 && methodCalls.Contains("final_digest")) { IIonValue finalDigest = actualHashLog.GetElementAt(actualHashLog.Count - 1); finalDigest.ClearAnnotations(); finalDigest.AddTypeAnnotation("final_digest"); result.Add(finalDigest); } else { enumerator = actualHashLog.GetEnumerator(); while (enumerator.MoveNext()) { IIonValue v = enumerator.Current; String methodCall = v.GetTypeAnnotationSymbols().ElementAt(0).Text; if (methodCalls.Contains(methodCall)) { result.Add(v); } } } return(result); }