Class Comparables

java.lang.Object
com.pholser.junit.quickcheck.internal.Comparables

public final class Comparables extends Object
  • Constructor Details

    • Comparables

      private Comparables()
  • Method Details

    • inRange

      public static <T extends Comparable<? super T>> Predicate<T> inRange(T min, T max)
    • leastMagnitude

      public static <T extends Comparable<? super T>> T leastMagnitude(T min, T max, T zero)
      Returns:
      the value with the lowest magnitude between the min, max and zero.
      • [-10, 5] = 0
      • [-10, -5] = -5
      • [5, 10] = 5
      • [-5, 0] = 0
      • [0, 5] = 0