private void checkState() throws IllegalStateException {
  if (consonants == null) {
    throw new IllegalStateException("The list of consonants is null.");
  }
  if (vowels == null) {
    throw new IllegalStateException("The list of vowels is null.");
  }
  if (consonants.size() == 0) {
    throw new IllegalStateException("The list of consonants is empty.");
  }
  if (vowels.size() == 0) {
    throw new IllegalStateException("The list of vowels is empty.");
  }
}

private void checkState ( ) throws IllegalStateException { if ( consonants == null ) { throw new IllegalStateException ( "The list of consonants is null." ) ; } if ( vowels == null ) { throw new IllegalStateException ( "The list of vowels is null." ) ; } if ( consonants . size ( ) == 0 ) { throw new IllegalStateException ( "The list of consonants is empty." ) ; } if ( vowels . size ( ) == 0 ) { throw new IllegalStateException ( "The list of vowels is empty." ) ; } }
checks the current state of the builder for any issue with it ' s state . if no issue is found , then no exception is thrown .
