Both isChecked() andisNotChecked() expect Checkable interface to be implemented by the view.

Moreover, BottomNavigationItemView hides its checked status inside of the itemData field. This means that Espresso out of the box does not support this kind of a check. Luckily, Espresso is a very extensible framework and you can easily add functionality to it. In this case, we need to write a custom matcher to do the check.