There's really not enough information here to enable us to help much. You don't give us the semantics of the calls that set the data up, and you don't show us the implementations of your check methods. Nor do you tell us what language you're working in. We can make some guesses, but no matter how you look at it there's way too much missing. Programming is a detailed business, so give us the details that matter to your question.