class SortedArrayToBST {

  public BinaryNode<Integer> transform(Integer[] sortedArray) {
    if (sortedArray == null || sortedArray.length == 0) {
      throw new IllegalArgumentException("You can't use a null or empty array.");
    }
    return transformToBST(sortedArray, 0, sortedArray.length - 1);
  }

}