#!/usr/bin/env bash # Regenerates every file in output/. Needs JDK 25 and Maven. First run must be online. # 01-04, 06-08 are written by JUnit tests that assert the same numbers (deterministic). # 05 is a MEASUREMENT (lost updates differ on every run) and is not asserted by any test. set -euo pipefail cd "$(dirname "$0")/.." mkdir -p output mvn -B -q test mvn -B -q compile { java -Xmx512m \ --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED \ -cp target/classes com.ankurm.interviewlab.hashmapvschm.LostUpdateDemo 2>&1 \ | grep -v '^Picked up JAVA_TOOL_OPTIONS' ; } > output/05-measured-lost-updates.txt # The first line of 05 names the machine's core count; the rest varies run to run by design. echo "done:"; ls -1 output