public void registerHandler(Handler handler) {
    if (!caresAboutLayer(handler)) {
      return;
    }
    this.handlers.add(handler);
    if (handler instanceof OsmNodePreprocessor osmNodePreprocessor) {
      osmNodePreprocessors.add(osmNodePreprocessor);
    }
    if (handler instanceof OsmWayPreprocessor osmWayPreprocessor) {
      osmWayPreprocessors.add(osmWayPreprocessor);
    }
    if (handler instanceof OsmRelationPreprocessor osmRelationPreprocessor) {
      osmRelationPreprocessors.add(osmRelationPreprocessor);
    }
    if (handler instanceof FinishHandler finishHandler) {
      finishHandlers.add(finishHandler);
    }
    if (handler instanceof LayerPostProcessor postProcessor) {
      layerPostProcessors.computeIfAbsent(postProcessor.name(), name -> new ArrayList<>())
        .add(postProcessor);
    }
    if (handler instanceof TilePostProcessor postProcessor) {
      tilePostProcessors.add(postProcessor);
    }
    if (handler instanceof FeatureProcessor processor) {
      registerFeatureHandler(processor);
    }
  }
Call {@code handler} for different events based on which interfaces {@code handler} implements:
{@link OsmRelationPreprocessor}, {@link FinishHandler}, {@link TilePostProcessor} or {@link LayerPostProcessor}.
planetiler-core/src/main/java/com/onthegomap/planetiler/ForwardingProfile.java