Extended UT to cover all cases.

* localOnly flag
* remoteOnly flag
* asExpired flag
* both localOnly and remoteOnly flags combined