added InvalidArgumentException test and throws