make use of assertContainsOnlyInstancesOf

Change-Id: I8b214a25312460dd6613f771dcc67c7cc0bb9540
Merge "make use of assertContainsOnlyInstancesOf"