private void validate ( ) { long delayedEventCount = delayedEvents . size ( ) ; long outstandingAgents = config . agents - agentsAvailable . size ( ) ; long outstandingPhones = config . numbers - phoneNumbersAvailable . size ( ) ; if ( outstandingAgents != outstandingPhones ) { throw new RuntimeException ( String . format ( "outstandingAgents (%d) != outstandingPhones (%d)" , outstandingAgents , outstandingPhones ) ) ; } if ( outstandingAgents != delayedEventCount ) { throw new RuntimeException ( String . format ( "outstandingAgents (%d) != delayedEventCount (%d)" , outstandingAgents , delayedEventCount ) ) ; } }
Smoke check on validity of data structures . This was useful while getting the code right for this class but it doesn t do much now unless the code needs changes .