assertNotEmpty static method

void assertNotEmpty(
  1. Iterable sample
)

Throws an exception if sample is empty.

Implementation

static void assertNotEmpty(Iterable sample) {
  if (sample.isEmpty) {
    throw ExceptionOfType<EmptyIterable>(
      message: 'Stats can not be calculated.',
      invalidState: 'Sample is empty.',
    );
  }
}