svoid test_AllOnAllWithUpdates() { for (bool variation : falseTrue()) { new AllOnAllWithUpdates aoa; aoa.newA("one"); assertNullVerbose(aoa.next()); aoa.newB(1); assertEqualsVerbose(pair("one", 1), aoa.next()); assertNullVerbose(aoa.next()); aoa.newB(2); if (!variation) aoa.newA("two"); assertEqualsVerbose(pair("one", 2), aoa.next()); if (variation) { assertNullVerbose(aoa.next()); aoa.newA("two"); } assertEqualsVerbose(pair("two", 1), aoa.next()); assertEqualsVerbose(pair("two", 2), aoa.next()); assertNullVerbose(aoa.next()); } new AllOnAllWithUpdates aoa; aoa.newA("one"); aoa.newB(1); aoa.newA("two"); aoa.newB(2); assertEqualsVerbose(pair("one", 1), aoa.next()); assertEqualsVerbose(pair("two", 1), aoa.next()); assertEqualsVerbose(pair("one", 2), aoa.next()); assertEqualsVerbose(pair("two", 2), aoa.next()); assertNullVerbose(aoa.next()); print("test updates"); aoa.updateA("one"); aoa.updateB(2); assertEqualsVerbose(pair("one", 1), aoa.next()); assertEqualsVerbose(pair("two", 2), aoa.next()); assertEqualsVerbose(pair("one", 2), aoa.next()); assertNullVerbose(aoa.next()); }