public void splitSwappingPartition(int[] array) {
    if (array == null) {
      throw new IllegalArgumentException("Array passed as parameter can't be null.");
    }

    int left = 0;
    int right = array.length - 1;
    while (left < right) {
      while (array[left] < 0 && left < right) {
        left++;
      }
      while (array[right] >= 0 && left < right) {
        right--;
      }
      if (left < right) {
        swap(array, left, right);
        left++;
        right--;
      }
    }
  }
Using partition Method of Quicksort to split the array.
Its called Hoare's Partitioning Algorithm
src/main/java/com/github/pedrovgs/problem8/SplitArray.java