For this lets not get 2 of the same object. For this if the "text" property that is going to be tested get the parent object instead and use that to test..
That is fine for now, but please think ahead and move it as soon as you have used it elsewhere. Also, by moving it to a more general place, others will notice and use it, instead of duplicating.