question: private void findMatchesInContexts ( List < NumberContext > contexts , boolean isValid , boolean isPossible , String region , String number ) { if ( isValid ) { doTestInContext ( number , region , contexts , Leniency . VALID ) ; } else { for ( NumberContext context : contexts ) { String text = context . leadingText + number + context . trailingText ; assertTrue ( "Should not have found a number in " + text , hasNoMatches ( phoneUtil . findNumbers ( text , region ) ) ) ; } } if ( isPossible ) { doTestInContext ( number , region , contexts , Leniency . POSSIBLE ) ; } else { for ( NumberContext context : contexts ) { String text = context . leadingText + number + context . trailingText ; assertTrue ( "Should not have found a number in " + text , hasNoMatches ( phoneUtil . findNumbers ( text , region , Leniency . POSSIBLE , Long . MAX_VALUE ) ) ) ; } } }
target:  Helper method which tests the contexts provided and ensures that: -- if isValid is true, they all find a test number inserted in the middle when leniency of matching is set to VALID; else no test number should be extracted at that leniency level -- if isPossible is true, they all find a test number inserted in the middle when leniency of matching is set to POSSIBLE; else no test number should be extracted at that leniency level