### Question:
CommandUtils { public static <T> void moveRows(final List<T> allRows, final List<T> rowsToMove, final int index) { final int oldBlockStart = allRows.indexOf(rowsToMove.get(0)); allRows.removeAll(rowsToMove); if (index < oldBlockStart) { allRows.addAll(index, rowsToMove); } else if (index > oldBlockStart) { allRows.addAll(index - rowsToMove.size() + 1, rowsToMove); } }  static void updateRowNumbers(final GridData uiModel,
                                        final IntStream rangeOfRowsToUpdate); static void moveRows(final List<T> allRows,
                                    final List<T> rowsToMove,
                                    final int index); static void moveComponentWidths(final int index,
                                           final int oldIndex,
                                           final List<Double> componentWidths,
                                           final List<Integer> uiColumnIndexes); static void updateParentInformation(final GridData uiModel); static Optional<GridCellValue<?>> extractGridCellValue(final GridCellTuple cellTuple);  }### Answer:
@Test public void testMoveOneRowUp() { CommandUtils.moveRows(allRows, Collections.singletonList(decisionRuleThree), 0); Assertions.assertThat(allRows).containsSequence(decisionRuleThree, decisionRuleOne, decisionRuleTwo); }
@Test public void testMoveOneRowUpMiddle() { CommandUtils.moveRows(allRows, Collections.singletonList(decisionRuleThree), 1); Assertions.assertThat(allRows).containsSequence(decisionRuleOne, decisionRuleThree, decisionRuleTwo); }
@Test public void testMoveOneRowDown() { CommandUtils.moveRows(allRows, Collections.singletonList(decisionRuleOne), 2); Assertions.assertThat(allRows).containsSequence(decisionRuleTwo, decisionRuleThree, decisionRuleOne); }
@Test public void testMoveOneRowDownMiddle() { CommandUtils.moveRows(allRows, Collections.singletonList(decisionRuleOne), 1); Assertions.assertThat(allRows).containsSequence(decisionRuleTwo, decisionRuleOne, decisionRuleThree); }
@Test public void testMoveTwoRowsUp() { CommandUtils.moveRows(allRows, Arrays.asList(decisionRuleTwo, decisionRuleThree), 0); Assertions.assertThat(allRows).containsSequence(decisionRuleTwo, decisionRuleThree, decisionRuleOne); }
@Test public void testMoveTwoRowsDown() { CommandUtils.moveRows(allRows, Arrays.asList(decisionRuleOne, decisionRuleTwo), 2); Assertions.assertThat(allRows).containsSequence(decisionRuleThree, decisionRuleOne, decisionRuleTwo); }