Instead of duplicating `runAndCheck`, another argument would probably do the trick (e.g. `boolean expectedStartsWith`).