Bug: Replace accidently deleted method

This method was accidently removed by a rebase in
I04feebe2e83f9e376fe5e5a13b404ca5605ec269. Additionally adds a test to
prevent future accidents.

Change-Id: I102c395a0fe9eff37abe56afe1faab09bb5d5fc0