public void RunSort(Func <ReadOnlyCollection <int>, ReadOnlyCollection <int> > action) { try{ int numberCount = inputOutputHandler.PromptUserForNumber("Enter the how many numbers that will be sorted:"); ReadOnlyCollection <int> originalNumbers = inputOutputHandler.BuildNumbersArray(numberCount); ReadOnlyCollection <int> sortedNumbers = action(originalNumbers); inputOutputHandler.OutputNumbers("Before: ", originalNumbers); inputOutputHandler.OutputNumbers("After: ", sortedNumbers); }catch (Exception ex) { inputOutputHandler.Output($"Error occurred {ex.Message}"); } inputOutputHandler.Output("Press any key to quit the application."); inputOutputHandler.ReadInput(); }