internal virtual void Collect()
            {
                TotalTimeMillis  = currentTimeMillis() - StartTime;
                StageVmPauseTime = VmPauseTimeAccumulator.PauseTime - BaseVmPauseTime;
                long lastDoneBatches = DoneBatches;

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: for (Step<?> step : execution.steps())
                foreach (Step <object> step in Execution.steps())
                {
                    StepStats stats           = step.Stats();
                    Stat      memoryUsageStat = stats.Stat(Keys.memory_usage);
                    if (memoryUsageStat != null)
                    {
                        MemoryUsage = max(MemoryUsage, memoryUsageStat.AsLong());
                    }
                    Stat ioStat = stats.Stat(Keys.io_throughput);
                    if (ioStat != null)
                    {
                        IoThroughput = ioStat.AsLong();
                    }
                    lastDoneBatches = stats.Stat(Keys.done_batches).asLong();
                }
                DoneBatches = lastDoneBatches;
            }