@Nullable
  private static <T> T myMove(int index, int direction, List<T> elements) {
    int target = index + direction;
    if (0 <= index && index < elements.size() && 0 <= target && target < elements.size()) {
      final T element1 = elements.get(index);
      final T element2 = elements.get(target);
      elements.set(index, element2);
      elements.set(target, element1);
      return element1;
    }
    return null;
  }
@Nullable
  private static <T> T myMove(int index, int direction, List<T> elements)