Testing and research of Query and ForEach