What do you mean by invalid? You can only get array (empty or not) or exception calling this method.

For me your problem come from your spec which does not return the good thing. You never have to test all possibilities, just the things which can be return by getActiveCodes().