quick sort in java

using middle element as the pivot