class StatisticsMonitor {

  public void removeListener(final StatisticsListener listener) {
    if (listener == null) {
      throw new NullPointerException("StatisticsListener is null");
    }
    synchronized (this.mutex) {
      if (this.listeners.contains(listener)) {
        this.listeners.remove(listener);
        if (this.listeners.isEmpty()) {
          try {
            getStatMonitorHandler().removeMonitor(this);
          } catch (IllegalStateException ignore) {
            // sample collector and handlers were closed (ok on removal)
          }
        }
      }
    }
  }

  public  StatisticsMonitor();

}