Prototype: incrementSequential(int increments) -> long starts a local counter at zero and increments it increments times. Negative increments raise IllegalArgumentException; zero returns zero.
Final: incrementConcurrent(int workers,int increments) -> long throws InterruptedException requires workers>0 and increments>=0 before starting threads. Start workers platform threads, each performing increments increments on one shared counter using a correct atomic or locking protocol, join all, and return the exact product. No global state, sleeps, or busy waiting; zero increments is valid. Inputs in tests are small enough to finish promptly. If the caller is interrupted, interrupt and join started workers before propagating InterruptedException.
Complete the starter code, then run the checks.
Results and errors will appear here.
Java runs on this device with CheerpJ 4.3.