@@ -0,0 +1,1075 @@
+package org.jctools.sets;%0A%0Aimport org.openjdk.jcstress.annotations.Actor;%0Aimport org.openjdk.jcstress.annotations.JCStressTest;%0Aimport org.openjdk.jcstress.annotations.Outcome;%0Aimport org.openjdk.jcstress.annotations.State;%0Aimport org.openjdk.jcstress.infra.results.BooleanResult1;%0A%0Aimport static org.openjdk.jcstress.annotations.Expect.ACCEPTABLE;%0Aimport static org.openjdk.jcstress.annotations.Expect.FORBIDDEN;%0A%0A/**%0A * @author Tolstopyatov Vsevolod%0A * @since 23/04/17%0A */%0A@JCStressTest%0A@Outcome(id = %22true%22, expect = ACCEPTABLE, desc = %22Ok%22)%0A@Outcome(expect = FORBIDDEN, desc = %22Removal considered harmful%22)%0A@State%0Apublic class SingleWriterHashSetRemovalTest %7B%0A%0A    private final SingleWriterHashSet%3CInteger%3E set = new SingleWriterHashSet%3C%3E(16);%0A%0A    public SingleWriterHashSetRemovalTest() %7B%0A        // Collide elements so removal of 1 will shift 17%0A        set.add(1);%0A        set.add(17);%0A    %7D%0A%0A    @Actor%0A    public void actor1() %7B%0A        set.remove(1);%0A    %7D%0A%0A    @Actor%0A    public void actor2(BooleanResult1 result) %7B%0A        result.r1 = set.contains(17);%0A    %7D%0A%7D%0A

Add jcstress test which reveals issue with compacting during removal from SingleWriterHashSet