@Override
    public Member next() {
        Member memberToReturn = nextMember;
        nextMember = null;
        if (memberToReturn != null) {
            return memberToReturn;
        }
        if (!advance()) {
            throw new NoSuchElementException("no more elements");
        }
        memberToReturn = nextMember;
        nextMember = null;
        return memberToReturn;
    }
@Test(expected = NoSuchElementException.class)
    public void give() {
        int maxRetries = 0;
        addClusterMember();

        RestartingMemberIterator iterator = new RestartingMemberIterator(mockClusterService, maxRetries);
        iterator.next();

        //this should throw NoSuchElementException
        iterator.next();
    }