Check for balanced parentheses
I just wanted to write that the code looks completely fine to me, until...
assertEquals(false, isBalanced(&quot;[[&quot;));

I''m sure you'll find the error :-)
Otherwise two small remarks:

Personally I'd have the function return true for an empty string instead of throwing an exception.

Stack is outdated. I'd use a Deque implementation instead.


EDIT: I'm sorry, but I just realized something else: Your program doesn't fulfill the requirement O(n/2) for space complexity.