code: public int purge(int minPts) {
          List<Neuron> outliers = new ArrayList<>();
          for (Neuron neuron : neurons) {
              if (neuron.n < minPts) {
                  outliers.add(neuron);
              }
          }
          
          neurons.removeAll(outliers);
          for (Neuron neuron : neurons) {
              neuron.neighbors.removeAll(outliers);
          }
          
          outliers.clear();
          for (Neuron neuron : neurons) {
              if (neuron.neighbors.isEmpty()) {
                  outliers.add(neuron);
              }
          }
          
          neurons.removeAll(outliers);
          return neurons.size();
      }
docs: Removes neurons with the number of samples less than a given threshold.
  The neurons without neighbors will also be removed.
  @param minPts neurons will be removed if the number of its points is
  less than minPts.
  @return the number of neurons after purging.