public Optional<Double> avg(){
  if (isEmpty())   return Optional.empty();
  return Optional.of(sum() / getEventCount());
}

public Optional < Double > avg ( ) { if ( isEmpty ( ) ) return Optional . empty ( ) ; return Optional . of ( sum ( ) / getEventCount ( ) ) ; }
return the average of the histogram .
