Spock spec for SeqNumberService

I implement a test specification for SeqNumberService and fix some bugs
in that class.