Queue model and tests