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

private void checkState ( ) throws IllegalStateException { if ( trainingNames == null ) { throw new IllegalStateException ( "The list of training names is null." ) ; } if ( trainingNames . size ( ) == 0 ) { throw new IllegalStateException ( "The list of training names 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 .
