class MoveElementsToPositions {

  public void move(int[] array) {
    validateInput(array);
    int size = array.length;
    boolean swap = true;
    while (swap) {
      swap = false;
      for (int i = 0; i < size - 1; i++) {
        if (array[i] > array[i + 1]) {
          swap = true;
          swapElements(array, i, i + 1);
        }
      }
    }
  }

}