package com.saasquatch.jsonschemainferrer;

import java.util.Collection;
import com.fasterxml.jackson.databind.JsonNode;

/**
 * Utilities for {@link DefaultPolicy}
 *
 * @author sli
 */
public final class DefaultPolicies {

  private DefaultPolicies() {}

  /**
   * @return a singleton {@link DefaultPolicy} that does nothing
   */
  public static DefaultPolicy noOp() {
    return input -> null;
  }

  /**
   * @return a singleton {@link DefaultPolicy} that always uses the first sample as {@code default}
   */
  public static DefaultPolicy useFirstSamples() {
    return input -> {
      final Collection<? extends JsonNode> samples = input.getSamples();
      return samples.stream().findFirst().orElse(null);
    };
  }

  /**
   * @return a singleton {@link DefaultPolicy} that always uses the last sample as {@code default}
   */
  public static DefaultPolicy useLastSamples() {
    return input -> {
      final Collection<? extends JsonNode> samples = input.getSamples();
      return samples.stream().skip(Math.max(0, samples.size() - 1)).findFirst().orElse(null);
    };
  }

}

@@ -113,16 +113,75 @@
 sonNode;
+%0Aimport com.saasquatch.jsonschemainferrer.annotations.Beta;
 %0A%0A/**%0A *
@@ -884,32 +884,40 @@
  default%7D%0A   */%0A
+  @Beta%0A
   public static 

add Beta annotation