add unit test that uses stateful API