I'm performing some measuring tests on sorting algorithms.

I create this method that calculates the time that seletion sort needs to order an array

```
public static double timeToSelectionSort(Double[] arrayOfNumbers) {

      double timeToSelectionSort =0;
  Stopwatch stopwatch = new Stopwatch();

  Selection.sort(arrayOfNumbers);

  timeToSelectionSort = stopwatch.elapsedTime(); 

  return   timeToSelectionSort;
  }

```

The problem is that I need to create this method for all of my sort algorithms(insertion, selection, quicksort, mergesort...)

Is there any way of passing these algorithms as a parameter of this method?