I see no reason to handle an empty array specially. This should be enough:
```
int size = 0;
for (; size < handlers.length; size ++) {
    if (handlers[size] == null) break;
}
```

Also, this change will make the array iteration performed twice - once for counting and then for adding.  Let's revert the last commit and merge for now.