Deduplicate code that asserts on instrumentation

Flag: EXEMPT refactor
Change-Id: Ib1d1cccebe48adc3de1dae8f206d3c8076128e98
4 files changed