Add convenience function and corresponding spec.