using System.Collections.Concurrent; namespace ConsoleApp3 { internal class Program { static void Main(string[] args) { var tests=new ConcurrentQueue(); tests.TryDequeue(out var result); if (result != null) { Console.WriteLine("not null"); } else { Console.WriteLine("result is null"); } } class MyClass { } } }