@Test
public void sortedRowsView() {

  final DenseDoubleMatrix2D input =
      new DenseDoubleMatrix2D(
          new double[][] {
            {1, -1},
            {2, -2},
            {3, -3}
          });
  final int[] order = new int[] {2, 1, 0};
  MatrixAssertions.assertThat(
          MatrixUtils.sortedRowsView(input, new IndirectComparator.AscendingIntComparator(order)))
      .isEquivalentTo(
          new double[][] {
            {3, -3},
            {2, -2},
            {1, -1}
          });
}