Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg

This software is released under an open source BSD licence.

fj.test
Class Arbitrary<A>

java.lang.Object
  extended by fj.test.Arbitrary<A>

public final class Arbitrary<A>
extends Object

The type used to generate arbitrary values of the given type parameter (A). Common arbitrary implementations are provided.


Field Summary
static Arbitrary<String> arbAlphaNumString
          An arbitrary implementation for string values with alpha-numeric characters.
static Arbitrary<BigDecimal> arbBigDecimal
          An arbitrary implementation for big decimals.
static Arbitrary<BigInteger> arbBigInteger
          An arbitrary implementation for big integers.
static Arbitrary<BitSet> arbBitSet
          An arbitrary implementation for bit sets.
static Arbitrary<Boolean> arbBoolean
          An arbitrary implementation for boolean values.
static Arbitrary<Byte> arbByte
          An arbitrary implementation for byte values.
static Arbitrary<Byte> arbByteBoundaries
          An arbitrary implementation for byte values that checks boundary values (0, 1, -1, max, min, max - 1, min + 1) with a frequency of 1% each then generates from arbByte the remainder of the time (93%).
static Arbitrary<Calendar> arbCalendar
          An arbitrary implementation for calendars.
static Arbitrary<Character> arbCharacter
          An arbitrary implementation for character values.
static Arbitrary<Character> arbCharacterBoundaries
          An arbitrary implementation for character values that checks boundary values (max, min, max - 1, min + 1) with a frequency of 1% each then generates from arbCharacter the remainder of the time (96%).
static Arbitrary<Date> arbDate
          An arbitrary implementation for dates.
static Arbitrary<Double> arbDouble
          An arbitrary implementation for double values.
static Arbitrary<Double> arbDoubleBoundaries
          An arbitrary implementation for double values that checks boundary values (0, 1, -1, max, min, min (normal), NaN, -infinity, infinity, max - 1) with a frequency of 1% each then generates from arbDouble the remainder of the time (91%).
static Arbitrary<Float> arbFloat
          An arbitrary implementation for float values.
static Arbitrary<Float> arbFloatBoundaries
          An arbitrary implementation for float values that checks boundary values (0, 1, -1, max, min, NaN, -infinity, infinity, max - 1) with a frequency of 1% each then generates from arbFloat the remainder of the time (91%).
static Arbitrary<GregorianCalendar> arbGregorianCalendar
          An arbitrary implementation for gregorian calendars.
static Arbitrary<Integer> arbInteger
          An arbitrary implementation for integer values.
static Arbitrary<Integer> arbIntegerBoundaries
          An arbitrary implementation for integer values that checks boundary values (0, 1, -1, max, min, max - 1, min + 1) with a frequency of 1% each then generates from arbInteger the remainder of the time (93%).
static Arbitrary<Locale> arbLocale
          An arbitrary implementation for locales.
static Arbitrary<Long> arbLong
          An arbitrary implementation for long values.
static Arbitrary<Long> arbLongBoundaries
          An arbitrary implementation for long values that checks boundary values (0, 1, -1, max, min, max - 1, min + 1) with a frequency of 1% each then generates from arbLong the remainder of the time (93%).
static Arbitrary<Properties> arbProperties
          An arbitrary implementation for properties.
static Arbitrary<Short> arbShort
          An arbitrary implementation for short values.
static Arbitrary<Short> arbShortBoundaries
          An arbitrary implementation for short values that checks boundary values (0, 1, -1, max, min, max - 1, min + 1) with a frequency of 1% each then generates from arbShort the remainder of the time (93%).
static Arbitrary<Date> arbSQLDate
          An arbitrary implementation for SQL dates.
static Arbitrary<String> arbString
          An arbitrary implementation for string values.
static Arbitrary<StringBuffer> arbStringBuffer
          An arbitrary implementation for string buffer values.
static Arbitrary<StringBuilder> arbStringBuilder
          An arbitrary implementation for string builder values.
static Arbitrary<Throwable> arbThrowable
          An arbitrary implementation for throwables.
static Arbitrary<Time> arbTime
          An arbitrary implementation for SQL times.
static Arbitrary<Timestamp> arbTimestamp
          An arbitrary implementation for SQL time stamps.
static Arbitrary<String> arbUSASCIIString
          An arbitrary implementation for string values with characters in the US-ASCII range.
 Gen<A> gen
          The generator associated with this arbitrary.
 
Method Summary
static
<A> Arbitrary<Array<A>>
arbArray(Arbitrary<A> aa)
          Returns an arbitrary implementation for arrays.
static
<A> Arbitrary<ArrayBlockingQueue<A>>
arbArrayBlockingQueue(Arbitrary<A> aa)
          Returns an arbitrary implementation for array blocking queues.
static
<A> Arbitrary<ArrayList<A>>
arbArrayList(Arbitrary<A> aa)
          Returns an arbitrary implementation for array lists.
static
<K,V> Arbitrary<ConcurrentHashMap<K,V>>
arbConcurrentHashMap(Arbitrary<K> ak, Arbitrary<V> av)
          Returns an arbitrary implementation for concurrent hash maps.
static
<A> Arbitrary<ConcurrentLinkedQueue<A>>
arbConcurrentLinkedQueue(Arbitrary<A> aa)
          Returns an arbitrary implementation for concurrent linked queues.
static
<A> Arbitrary<CopyOnWriteArrayList<A>>
arbCopyOnWriteArrayList(Arbitrary<A> aa)
          Returns an arbitrary implementation for copy-on-write array lists.
static
<A> Arbitrary<CopyOnWriteArraySet<A>>
arbCopyOnWriteArraySet(Arbitrary<A> aa)
          Returns an arbitrary implementation for copy-on-write array sets.
static
<A extends Delayed>
Arbitrary<DelayQueue<A>>
arbDelayQueue(Arbitrary<A> aa)
          Returns an arbitrary implementation for delay queues.
static
<A,B> Arbitrary<Either<A,B>>
arbEither(Arbitrary<A> aa, Arbitrary<B> ab)
          Returns an arbitrary implementation for the disjoint union.
static
<K extends Enum<K>,V>
Arbitrary<EnumMap<K,V>>
arbEnumMap(Arbitrary<K> ak, Arbitrary<V> av)
          Returns an arbitrary implementation for enum maps.
static
<A extends Enum<A>>
Arbitrary<EnumSet<A>>
arbEnumSet(Arbitrary<A> aa)
          Returns an arbitrary implementation for enum sets.
static
<A extends Enum<A>>
Arbitrary<A>
arbEnumValue(Class<A> clazz)
          Returns an arbitrary implementation for a Java enumeration.
static
<A,B> Arbitrary<F<A,B>>
arbF(Coarbitrary<A> c, Arbitrary<B> a)
          An arbitrary for functions.
static
<A,B,C> Arbitrary<F2<A,B,C>>
arbF2(Coarbitrary<A> ca, Coarbitrary<B> cb, Arbitrary<C> a)
          An arbitrary for function-2.
static
<A,B,C> Arbitrary<F2<A,B,C>>
arbF2Invariant(Arbitrary<C> a)
          An arbitrary for function-2.
static
<A,B,C,D> Arbitrary<F3<A,B,C,D>>
arbF3(Coarbitrary<A> ca, Coarbitrary<B> cb, Coarbitrary<C> cc, Arbitrary<D> a)
          An arbitrary for function-3.
static
<A,B,C,D> Arbitrary<F3<A,B,C,D>>
arbF3Invariant(Arbitrary<D> a)
          An arbitrary for function-3.
static
<A,B,C,D,E>
Arbitrary<F4<A,B,C,D,E>>
arbF4(Coarbitrary<A> ca, Coarbitrary<B> cb, Coarbitrary<C> cc, Coarbitrary<D> cd, Arbitrary<E> a)
          An arbitrary for function-4.
static
<A,B,C,D,E>
Arbitrary<F4<A,B,C,D,E>>
arbF4Invariant(Arbitrary<E> a)
          An arbitrary for function-4.
static
<A,B,C,D,E,F$>
Arbitrary<F5<A,B,C,D,E,F$>>
arbF5(Coarbitrary<A> ca, Coarbitrary<B> cb, Coarbitrary<C> cc, Coarbitrary<D> cd, Coarbitrary<E> ce, Arbitrary<F$> a)
          An arbitrary for function-5.
static
<A,B,C,D,E,F$>
Arbitrary<F5<A,B,C,D,E,F$>>
arbF5Invariant(Arbitrary<F$> a)
          An arbitrary for function-5.
static
<A,B,C,D,E,F$,G>
Arbitrary<F6<A,B,C,D,E,F$,G>>
arbF6(Coarbitrary<A> ca, Coarbitrary<B> cb, Coarbitrary<C> cc, Coarbitrary<D> cd, Coarbitrary<E> ce, Coarbitrary<F$> cf, Arbitrary<G> a)
          An arbitrary for function-6.
static
<A,B,C,D,E,F$,G>
Arbitrary<F6<A,B,C,D,E,F$,G>>
arbF6Invariant(Arbitrary<G> a)
          An arbitrary for function-6.
static
<A,B,C,D,E,F$,G,H>
Arbitrary<F7<A,B,C,D,E,F$,G,H>>
arbF7(Coarbitrary<A> ca, Coarbitrary<B> cb, Coarbitrary<C> cc, Coarbitrary<D> cd, Coarbitrary<E> ce, Coarbitrary<F$> cf, Coarbitrary<G> cg, Arbitrary<H> a)
          An arbitrary for function-7.
static
<A,B,C,D,E,F$,G,H>
Arbitrary<F7<A,B,C,D,E,F$,G,H>>
arbF7Invariant(Arbitrary<H> a)
          An arbitrary for function-7.
static
<A,B,C,D,E,F$,G,H,I>
Arbitrary<F8<A,B,C,D,E,F$,G,H,I>>
arbF8(Coarbitrary<A> ca, Coarbitrary<B> cb, Coarbitrary<C> cc, Coarbitrary<D> cd, Coarbitrary<E> ce, Coarbitrary<F$> cf, Coarbitrary<G> cg, Coarbitrary<H> ch, Arbitrary<I> a)
          An arbitrary for function-8.
static
<A,B,C,D,E,F$,G,H,I>
Arbitrary<F8<A,B,C,D,E,F$,G,H,I>>
arbF8Invariant(Arbitrary<I> a)
          An arbitrary for function-8.
static
<A,B> Arbitrary<F<A,B>>
arbFInvariant(Arbitrary<B> a)
          An arbitrary for functions.
static
<A> Arbitrary<Gen<A>>
arbGen(Arbitrary<A> aa)
          Returns an arbitrary implementation for generators.
static
<K,V> Arbitrary<HashMap<K,V>>
arbHashMap(Arbitrary<K> ak, Arbitrary<V> av)
          Returns an arbitrary implementation for hash maps.
static
<A> Arbitrary<HashSet<A>>
arbHashSet(Arbitrary<A> aa)
          Returns an arbitrary implementation for hash sets.
static
<K,V> Arbitrary<Hashtable<K,V>>
arbHashtable(Arbitrary<K> ak, Arbitrary<V> av)
          Returns an arbitrary implementation for hash tables.
static
<K,V> Arbitrary<IdentityHashMap<K,V>>
arbIdentityHashMap(Arbitrary<K> ak, Arbitrary<V> av)
          Returns an arbitrary implementation for identity hash maps.
static
<A> Arbitrary<A>
arbitrary(Gen<A> g)
          Constructs and arbitrary with the given generator.
static
<A> Arbitrary<LinkedBlockingQueue<A>>
arbLinkedBlockingQueue(Arbitrary<A> aa)
          Returns an arbitrary implementation for linked blocking queues.
static
<K,V> Arbitrary<LinkedHashMap<K,V>>
arbLinkedHashMap(Arbitrary<K> ak, Arbitrary<V> av)
          Returns an arbitrary implementation for linked hash maps.
static
<A> Arbitrary<LinkedHashSet<A>>
arbLinkedHashSet(Arbitrary<A> aa)
          Returns an arbitrary implementation for hash sets.
static
<A> Arbitrary<LinkedList<A>>
arbLinkedList(Arbitrary<A> aa)
          Returns an arbitrary implementation for linked lists.
static
<A> Arbitrary<List<A>>
arbList(Arbitrary<A> aa)
          Returns an arbitrary implementation for lists.
static
<A> Arbitrary<Option<A>>
arbOption(Arbitrary<A> aa)
          Returns an arbitrary implementation for optional values.
static
<A> Arbitrary<P1<A>>
arbP1(Arbitrary<A> aa)
          Returns an arbitrary implementation for product-1 values.
static
<A,B> Arbitrary<P2<A,B>>
arbP2(Arbitrary<A> aa, Arbitrary<B> ab)
          Returns an arbitrary implementation for product-2 values.
static
<A,B,C> Arbitrary<P3<A,B,C>>
arbP3(Arbitrary<A> aa, Arbitrary<B> ab, Arbitrary<C> ac)
          Returns an arbitrary implementation for product-3 values.
static
<A,B,C,D> Arbitrary<P4<A,B,C,D>>
arbP4(Arbitrary<A> aa, Arbitrary<B> ab, Arbitrary<C> ac, Arbitrary<D> ad)
          Returns an arbitrary implementation for product-4 values.
static
<A,B,C,D,E>
Arbitrary<P5<A,B,C,D,E>>
arbP5(Arbitrary<A> aa, Arbitrary<B> ab, Arbitrary<C> ac, Arbitrary<D> ad, Arbitrary<E> ae)
          Returns an arbitrary implementation for product-5 values.
static
<A,B,C,D,E,F$>
Arbitrary<P6<A,B,C,D,E,F$>>
arbP6(Arbitrary<A> aa, Arbitrary<B> ab, Arbitrary<C> ac, Arbitrary<D> ad, Arbitrary<E> ae, Arbitrary<F$> af)
          Returns an arbitrary implementation for product-6 values.
static
<A,B,C,D,E,F$,G>
Arbitrary<P7<A,B,C,D,E,F$,G>>
arbP7(Arbitrary<A> aa, Arbitrary<B> ab, Arbitrary<C> ac, Arbitrary<D> ad, Arbitrary<E> ae, Arbitrary<F$> af, Arbitrary<G> ag)
          Returns an arbitrary implementation for product-7 values.
static
<A,B,C,D,E,F$,G,H>
Arbitrary<P8<A,B,C,D,E,F$,G,H>>
arbP8(Arbitrary<A> aa, Arbitrary<B> ab, Arbitrary<C> ac, Arbitrary<D> ad, Arbitrary<E> ae, Arbitrary<F$> af, Arbitrary<G> ag, Arbitrary<H> ah)
          Returns an arbitrary implementation for product-8 values.
static
<A> Arbitrary<PriorityBlockingQueue<A>>
arbPriorityBlockingQueue(Arbitrary<A> aa)
          Returns an arbitrary implementation for priority blocking queues.
static
<A> Arbitrary<PriorityQueue<A>>
arbPriorityQueue(Arbitrary<A> aa)
          Returns an arbitrary implementation for priority queues.
static
<A> Arbitrary<Stack<A>>
arbStack(Arbitrary<A> aa)
          Returns an arbitrary implementation for stacks.
static
<A> Arbitrary<Stream<A>>
arbStream(Arbitrary<A> aa)
          Returns an arbitrary implementation for streams.
static
<A> Arbitrary<SynchronousQueue<A>>
arbSynchronousQueue(Arbitrary<A> aa)
          Returns an arbitrary implementation for priority blocking queues.
static Arbitrary<Throwable> arbThrowable(Arbitrary<String> as)
          Returns an arbitrary implementation for throwables.
static
<K,V> Arbitrary<TreeMap<K,V>>
arbTreeMap(Arbitrary<K> ak, Arbitrary<V> av)
          Returns an arbitrary implementation for tree maps.
static
<A> Arbitrary<TreeSet<A>>
arbTreeSet(Arbitrary<A> aa)
          Returns an arbitrary implementation for tree sets.
static
<A> Arbitrary<Vector<A>>
arbVector(Arbitrary<A> aa)
          Returns an arbitrary implementation for vectors.
static
<K,V> Arbitrary<WeakHashMap<K,V>>
arbWeakHashMap(Arbitrary<K> ak, Arbitrary<V> av)
          Returns an arbitrary implementation for weak hash maps.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gen

public final Gen<A> gen
The generator associated with this arbitrary.


arbBoolean

public static final Arbitrary<Boolean> arbBoolean
An arbitrary implementation for boolean values.


arbInteger

public static final Arbitrary<Integer> arbInteger
An arbitrary implementation for integer values.


arbIntegerBoundaries

public static final Arbitrary<Integer> arbIntegerBoundaries
An arbitrary implementation for integer values that checks boundary values (0, 1, -1, max, min, max - 1, min + 1) with a frequency of 1% each then generates from arbInteger the remainder of the time (93%).


arbLong

public static final Arbitrary<Long> arbLong
An arbitrary implementation for long values.


arbLongBoundaries

public static final Arbitrary<Long> arbLongBoundaries
An arbitrary implementation for long values that checks boundary values (0, 1, -1, max, min, max - 1, min + 1) with a frequency of 1% each then generates from arbLong the remainder of the time (93%).


arbByte

public static final Arbitrary<Byte> arbByte
An arbitrary implementation for byte values.


arbByteBoundaries

public static final Arbitrary<Byte> arbByteBoundaries
An arbitrary implementation for byte values that checks boundary values (0, 1, -1, max, min, max - 1, min + 1) with a frequency of 1% each then generates from arbByte the remainder of the time (93%).


arbShort

public static final Arbitrary<Short> arbShort
An arbitrary implementation for short values.


arbShortBoundaries

public static final Arbitrary<Short> arbShortBoundaries
An arbitrary implementation for short values that checks boundary values (0, 1, -1, max, min, max - 1, min + 1) with a frequency of 1% each then generates from arbShort the remainder of the time (93%).


arbCharacter

public static final Arbitrary<Character> arbCharacter
An arbitrary implementation for character values.


arbCharacterBoundaries

public static final Arbitrary<Character> arbCharacterBoundaries
An arbitrary implementation for character values that checks boundary values (max, min, max - 1, min + 1) with a frequency of 1% each then generates from arbCharacter the remainder of the time (96%).


arbDouble

public static final Arbitrary<Double> arbDouble
An arbitrary implementation for double values.


arbDoubleBoundaries

public static final Arbitrary<Double> arbDoubleBoundaries
An arbitrary implementation for double values that checks boundary values (0, 1, -1, max, min, min (normal), NaN, -infinity, infinity, max - 1) with a frequency of 1% each then generates from arbDouble the remainder of the time (91%).


arbFloat

public static final Arbitrary<Float> arbFloat
An arbitrary implementation for float values.


arbFloatBoundaries

public static final Arbitrary<Float> arbFloatBoundaries
An arbitrary implementation for float values that checks boundary values (0, 1, -1, max, min, NaN, -infinity, infinity, max - 1) with a frequency of 1% each then generates from arbFloat the remainder of the time (91%).


arbString

public static final Arbitrary<String> arbString
An arbitrary implementation for string values.


arbUSASCIIString

public static final Arbitrary<String> arbUSASCIIString
An arbitrary implementation for string values with characters in the US-ASCII range.


arbAlphaNumString

public static final Arbitrary<String> arbAlphaNumString
An arbitrary implementation for string values with alpha-numeric characters.


arbStringBuffer

public static final Arbitrary<StringBuffer> arbStringBuffer
An arbitrary implementation for string buffer values.


arbStringBuilder

public static final Arbitrary<StringBuilder> arbStringBuilder
An arbitrary implementation for string builder values.


arbThrowable

public static final Arbitrary<Throwable> arbThrowable
An arbitrary implementation for throwables.


arbBitSet

public static final Arbitrary<BitSet> arbBitSet
An arbitrary implementation for bit sets.


arbCalendar

public static final Arbitrary<Calendar> arbCalendar
An arbitrary implementation for calendars.


arbDate

public static final Arbitrary<Date> arbDate
An arbitrary implementation for dates.


arbGregorianCalendar

public static final Arbitrary<GregorianCalendar> arbGregorianCalendar
An arbitrary implementation for gregorian calendars.


arbProperties

public static final Arbitrary<Properties> arbProperties
An arbitrary implementation for properties.


arbSQLDate

public static final Arbitrary<Date> arbSQLDate
An arbitrary implementation for SQL dates.


arbTime

public static final Arbitrary<Time> arbTime
An arbitrary implementation for SQL times.


arbTimestamp

public static final Arbitrary<Timestamp> arbTimestamp
An arbitrary implementation for SQL time stamps.


arbBigInteger

public static final Arbitrary<BigInteger> arbBigInteger
An arbitrary implementation for big integers.


arbBigDecimal

public static final Arbitrary<BigDecimal> arbBigDecimal
An arbitrary implementation for big decimals.


arbLocale

public static final Arbitrary<Locale> arbLocale
An arbitrary implementation for locales.

Method Detail

arbitrary

public static <A> Arbitrary<A> arbitrary(Gen<A> g)
Constructs and arbitrary with the given generator.

Parameters:
g - The generator to construct an arbitrary with.
Returns:
A new arbitrary that uses the given generator.

arbF

public static <A,B> Arbitrary<F<A,B>> arbF(Coarbitrary<A> c,
                                           Arbitrary<B> a)
An arbitrary for functions.

Parameters:
c - The coarbitrary for the function domain.
a - The arbitrary for the function codomain.
Returns:
An arbitrary for functions.

arbFInvariant

public static <A,B> Arbitrary<F<A,B>> arbFInvariant(Arbitrary<B> a)
An arbitrary for functions.

Parameters:
a - The arbitrary for the function codomain.
Returns:
An arbitrary for functions.

arbF2

public static <A,B,C> Arbitrary<F2<A,B,C>> arbF2(Coarbitrary<A> ca,
                                                 Coarbitrary<B> cb,
                                                 Arbitrary<C> a)
An arbitrary for function-2.

Parameters:
ca - A coarbitrary for the part of the domain of the function.
cb - A coarbitrary for the part of the domain of the function.
a - An arbitrary for the codomain of the function.
Returns:
An arbitrary for function-2.

arbF2Invariant

public static <A,B,C> Arbitrary<F2<A,B,C>> arbF2Invariant(Arbitrary<C> a)
An arbitrary for function-2.

Parameters:
a - The arbitrary for the function codomain.
Returns:
An arbitrary for function-2.

arbF3

public static <A,B,C,D> Arbitrary<F3<A,B,C,D>> arbF3(Coarbitrary<A> ca,
                                                     Coarbitrary<B> cb,
                                                     Coarbitrary<C> cc,
                                                     Arbitrary<D> a)
An arbitrary for function-3.

Parameters:
ca - A coarbitrary for the part of the domain of the function.
cb - A coarbitrary for the part of the domain of the function.
cc - A coarbitrary for the part of the domain of the function.
a - An arbitrary for the codomain of the function.
Returns:
An arbitrary for function-3.

arbF3Invariant

public static <A,B,C,D> Arbitrary<F3<A,B,C,D>> arbF3Invariant(Arbitrary<D> a)
An arbitrary for function-3.

Parameters:
a - The arbitrary for the function codomain.
Returns:
An arbitrary for function-3.

arbF4

public static <A,B,C,D,E> Arbitrary<F4<A,B,C,D,E>> arbF4(Coarbitrary<A> ca,
                                                         Coarbitrary<B> cb,
                                                         Coarbitrary<C> cc,
                                                         Coarbitrary<D> cd,
                                                         Arbitrary<E> a)
An arbitrary for function-4.

Parameters:
ca - A coarbitrary for the part of the domain of the function.
cb - A coarbitrary for the part of the domain of the function.
cc - A coarbitrary for the part of the domain of the function.
cd - A coarbitrary for the part of the domain of the function.
a - An arbitrary for the codomain of the function.
Returns:
An arbitrary for function-4.

arbF4Invariant

public static <A,B,C,D,E> Arbitrary<F4<A,B,C,D,E>> arbF4Invariant(Arbitrary<E> a)
An arbitrary for function-4.

Parameters:
a - The arbitrary for the function codomain.
Returns:
An arbitrary for function-4.

arbF5

public static <A,B,C,D,E,F$> Arbitrary<F5<A,B,C,D,E,F$>> arbF5(Coarbitrary<A> ca,
                                                               Coarbitrary<B> cb,
                                                               Coarbitrary<C> cc,
                                                               Coarbitrary<D> cd,
                                                               Coarbitrary<E> ce,
                                                               Arbitrary<F$> a)
An arbitrary for function-5.

Parameters:
ca - A coarbitrary for the part of the domain of the function.
cb - A coarbitrary for the part of the domain of the function.
cc - A coarbitrary for the part of the domain of the function.
cd - A coarbitrary for the part of the domain of the function.
ce - A coarbitrary for the part of the domain of the function.
a - An arbitrary for the codomain of the function.
Returns:
An arbitrary for function-5.

arbF5Invariant

public static <A,B,C,D,E,F$> Arbitrary<F5<A,B,C,D,E,F$>> arbF5Invariant(Arbitrary<F$> a)
An arbitrary for function-5.

Parameters:
a - The arbitrary for the function codomain.
Returns:
An arbitrary for function-5.

arbF6

public static <A,B,C,D,E,F$,G> Arbitrary<F6<A,B,C,D,E,F$,G>> arbF6(Coarbitrary<A> ca,
                                                                   Coarbitrary<B> cb,
                                                                   Coarbitrary<C> cc,
                                                                   Coarbitrary<D> cd,
                                                                   Coarbitrary<E> ce,
                                                                   Coarbitrary<F$> cf,
                                                                   Arbitrary<G> a)
An arbitrary for function-6.

Parameters:
ca - A coarbitrary for the part of the domain of the function.
cb - A coarbitrary for the part of the domain of the function.
cc - A coarbitrary for the part of the domain of the function.
cd - A coarbitrary for the part of the domain of the function.
ce - A coarbitrary for the part of the domain of the function.
cf - A coarbitrary for the part of the domain of the function.
a - An arbitrary for the codomain of the function.
Returns:
An arbitrary for function-6.

arbF6Invariant

public static <A,B,C,D,E,F$,G> Arbitrary<F6<A,B,C,D,E,F$,G>> arbF6Invariant(Arbitrary<G> a)
An arbitrary for function-6.

Parameters:
a - The arbitrary for the function codomain.
Returns:
An arbitrary for function-6.

arbF7

public static <A,B,C,D,E,F$,G,H> Arbitrary<F7<A,B,C,D,E,F$,G,H>> arbF7(Coarbitrary<A> ca,
                                                                       Coarbitrary<B> cb,
                                                                       Coarbitrary<C> cc,
                                                                       Coarbitrary<D> cd,
                                                                       Coarbitrary<E> ce,
                                                                       Coarbitrary<F$> cf,
                                                                       Coarbitrary<G> cg,
                                                                       Arbitrary<H> a)
An arbitrary for function-7.

Parameters:
ca - A coarbitrary for the part of the domain of the function.
cb - A coarbitrary for the part of the domain of the function.
cc - A coarbitrary for the part of the domain of the function.
cd - A coarbitrary for the part of the domain of the function.
ce - A coarbitrary for the part of the domain of the function.
cf - A coarbitrary for the part of the domain of the function.
cg - A coarbitrary for the part of the domain of the function.
a - An arbitrary for the codomain of the function.
Returns:
An arbitrary for function-7.

arbF7Invariant

public static <A,B,C,D,E,F$,G,H> Arbitrary<F7<A,B,C,D,E,F$,G,H>> arbF7Invariant(Arbitrary<H> a)
An arbitrary for function-7.

Parameters:
a - The arbitrary for the function codomain.
Returns:
An arbitrary for function-7.

arbF8

public static <A,B,C,D,E,F$,G,H,I> Arbitrary<F8<A,B,C,D,E,F$,G,H,I>> arbF8(Coarbitrary<A> ca,
                                                                           Coarbitrary<B> cb,
                                                                           Coarbitrary<C> cc,
                                                                           Coarbitrary<D> cd,
                                                                           Coarbitrary<E> ce,
                                                                           Coarbitrary<F$> cf,
                                                                           Coarbitrary<G> cg,
                                                                           Coarbitrary<H> ch,
                                                                           Arbitrary<I> a)
An arbitrary for function-8.

Parameters:
ca - A coarbitrary for the part of the domain of the function.
cb - A coarbitrary for the part of the domain of the function.
cc - A coarbitrary for the part of the domain of the function.
cd - A coarbitrary for the part of the domain of the function.
ce - A coarbitrary for the part of the domain of the function.
cf - A coarbitrary for the part of the domain of the function.
cg - A coarbitrary for the part of the domain of the function.
ch - A coarbitrary for the part of the domain of the function.
a - An arbitrary for the codomain of the function.
Returns:
An arbitrary for function-8.

arbF8Invariant

public static <A,B,C,D,E,F$,G,H,I> Arbitrary<F8<A,B,C,D,E,F$,G,H,I>> arbF8Invariant(Arbitrary<I> a)
An arbitrary for function-8.

Parameters:
a - The arbitrary for the function codomain.
Returns:
An arbitrary for function-8.

arbGen

public static <A> Arbitrary<Gen<A>> arbGen(Arbitrary<A> aa)
Returns an arbitrary implementation for generators.

Parameters:
aa - an arbitrary implementation for the type over which the generator is defined.
Returns:
An arbitrary implementation for generators.

arbOption

public static <A> Arbitrary<Option<A>> arbOption(Arbitrary<A> aa)
Returns an arbitrary implementation for optional values.

Parameters:
aa - an arbitrary implementation for the type over which the optional value is defined.
Returns:
An arbitrary implementation for optional values.

arbEither

public static <A,B> Arbitrary<Either<A,B>> arbEither(Arbitrary<A> aa,
                                                     Arbitrary<B> ab)
Returns an arbitrary implementation for the disjoint union.

Parameters:
aa - An arbitrary implementation for the type over which one side of the disjoint union is defined.
ab - An arbitrary implementation for the type over which one side of the disjoint union is defined.
Returns:
An arbitrary implementation for the disjoint union.

arbList

public static <A> Arbitrary<List<A>> arbList(Arbitrary<A> aa)
Returns an arbitrary implementation for lists.

Parameters:
aa - An arbitrary implementation for the type over which the list is defined.
Returns:
An arbitrary implementation for lists.

arbStream

public static <A> Arbitrary<Stream<A>> arbStream(Arbitrary<A> aa)
Returns an arbitrary implementation for streams.

Parameters:
aa - An arbitrary implementation for the type over which the stream is defined.
Returns:
An arbitrary implementation for streams.

arbArray

public static <A> Arbitrary<Array<A>> arbArray(Arbitrary<A> aa)
Returns an arbitrary implementation for arrays.

Parameters:
aa - An arbitrary implementation for the type over which the array is defined.
Returns:
An arbitrary implementation for arrays.

arbThrowable

public static Arbitrary<Throwable> arbThrowable(Arbitrary<String> as)
Returns an arbitrary implementation for throwables.

Parameters:
as - An arbitrary used for the throwable message.
Returns:
An arbitrary implementation for throwables.

arbArrayList

public static <A> Arbitrary<ArrayList<A>> arbArrayList(Arbitrary<A> aa)
Returns an arbitrary implementation for array lists.

Parameters:
aa - An arbitrary implementation for the type over which the array list is defined.
Returns:
An arbitrary implementation for array lists.

arbEnumValue

public static <A extends Enum<A>> Arbitrary<A> arbEnumValue(Class<A> clazz)
Returns an arbitrary implementation for a Java enumeration.

Parameters:
clazz - The type of enum to return an arbtrary of.
Returns:
An arbitrary for instances of the supplied enum type.

arbEnumMap

public static <K extends Enum<K>,V> Arbitrary<EnumMap<K,V>> arbEnumMap(Arbitrary<K> ak,
                                                                       Arbitrary<V> av)
Returns an arbitrary implementation for enum maps.

Parameters:
ak - An arbitrary implementation for the type over which the enum map's keys are defined.
av - An arbitrary implementation for the type over which the enum map's values are defined.
Returns:
An arbitrary implementation for enum maps.

arbEnumSet

public static <A extends Enum<A>> Arbitrary<EnumSet<A>> arbEnumSet(Arbitrary<A> aa)
Returns an arbitrary implementation for enum sets.

Parameters:
aa - An arbitrary implementation for the type over which the enum set is defined.
Returns:
An arbitrary implementation for enum sets.

arbHashMap

public static <K,V> Arbitrary<HashMap<K,V>> arbHashMap(Arbitrary<K> ak,
                                                       Arbitrary<V> av)
Returns an arbitrary implementation for hash maps.

Parameters:
ak - An arbitrary implementation for the type over which the hash map's keys are defined.
av - An arbitrary implementation for the type over which the hash map's values are defined.
Returns:
An arbitrary implementation for hash maps.

arbHashSet

public static <A> Arbitrary<HashSet<A>> arbHashSet(Arbitrary<A> aa)
Returns an arbitrary implementation for hash sets.

Parameters:
aa - An arbitrary implementation for the type over which the hash set is defined.
Returns:
An arbitrary implementation for hash sets.

arbHashtable

public static <K,V> Arbitrary<Hashtable<K,V>> arbHashtable(Arbitrary<K> ak,
                                                           Arbitrary<V> av)
Returns an arbitrary implementation for hash tables.

Parameters:
ak - An arbitrary implementation for the type over which the hash table's keys are defined.
av - An arbitrary implementation for the type over which the hash table's values are defined.
Returns:
An arbitrary implementation for hash tables.

arbIdentityHashMap

public static <K,V> Arbitrary<IdentityHashMap<K,V>> arbIdentityHashMap(Arbitrary<K> ak,
                                                                       Arbitrary<V> av)
Returns an arbitrary implementation for identity hash maps.

Parameters:
ak - An arbitrary implementation for the type over which the identity hash map's keys are defined.
av - An arbitrary implementation for the type over which the identity hash map's values are defined.
Returns:
An arbitrary implementation for identity hash maps.

arbLinkedHashMap

public static <K,V> Arbitrary<LinkedHashMap<K,V>> arbLinkedHashMap(Arbitrary<K> ak,
                                                                   Arbitrary<V> av)
Returns an arbitrary implementation for linked hash maps.

Parameters:
ak - An arbitrary implementation for the type over which the linked hash map's keys are defined.
av - An arbitrary implementation for the type over which the linked hash map's values are defined.
Returns:
An arbitrary implementation for linked hash maps.

arbLinkedHashSet

public static <A> Arbitrary<LinkedHashSet<A>> arbLinkedHashSet(Arbitrary<A> aa)
Returns an arbitrary implementation for hash sets.

Parameters:
aa - An arbitrary implementation for the type over which the hash set is defined.
Returns:
An arbitrary implementation for hash sets.

arbLinkedList

public static <A> Arbitrary<LinkedList<A>> arbLinkedList(Arbitrary<A> aa)
Returns an arbitrary implementation for linked lists.

Parameters:
aa - An arbitrary implementation for the type over which the linked list is defined.
Returns:
An arbitrary implementation for linked lists.

arbPriorityQueue

public static <A> Arbitrary<PriorityQueue<A>> arbPriorityQueue(Arbitrary<A> aa)
Returns an arbitrary implementation for priority queues.

Parameters:
aa - An arbitrary implementation for the type over which the priority queue is defined.
Returns:
An arbitrary implementation for priority queues.

arbStack

public static <A> Arbitrary<Stack<A>> arbStack(Arbitrary<A> aa)
Returns an arbitrary implementation for stacks.

Parameters:
aa - An arbitrary implementation for the type over which the stack is defined.
Returns:
An arbitrary implementation for stacks.

arbTreeMap

public static <K,V> Arbitrary<TreeMap<K,V>> arbTreeMap(Arbitrary<K> ak,
                                                       Arbitrary<V> av)
Returns an arbitrary implementation for tree maps.

Parameters:
ak - An arbitrary implementation for the type over which the tree map's keys are defined.
av - An arbitrary implementation for the type over which the tree map's values are defined.
Returns:
An arbitrary implementation for tree maps.

arbTreeSet

public static <A> Arbitrary<TreeSet<A>> arbTreeSet(Arbitrary<A> aa)
Returns an arbitrary implementation for tree sets.

Parameters:
aa - An arbitrary implementation for the type over which the tree set is defined.
Returns:
An arbitrary implementation for tree sets.

arbVector

public static <A> Arbitrary<Vector<A>> arbVector(Arbitrary<A> aa)
Returns an arbitrary implementation for vectors.

Parameters:
aa - An arbitrary implementation for the type over which the vector is defined.
Returns:
An arbitrary implementation for vectors.

arbWeakHashMap

public static <K,V> Arbitrary<WeakHashMap<K,V>> arbWeakHashMap(Arbitrary<K> ak,
                                                               Arbitrary<V> av)
Returns an arbitrary implementation for weak hash maps.

Parameters:
ak - An arbitrary implementation for the type over which the weak hash map's keys are defined.
av - An arbitrary implementation for the type over which the weak hash map's values are defined.
Returns:
An arbitrary implementation for weak hash maps.

arbArrayBlockingQueue

public static <A> Arbitrary<ArrayBlockingQueue<A>> arbArrayBlockingQueue(Arbitrary<A> aa)
Returns an arbitrary implementation for array blocking queues.

Parameters:
aa - An arbitrary implementation for the type over which the array blocking queue is defined.
Returns:
An arbitrary implementation for array blocking queues.

arbConcurrentHashMap

public static <K,V> Arbitrary<ConcurrentHashMap<K,V>> arbConcurrentHashMap(Arbitrary<K> ak,
                                                                           Arbitrary<V> av)
Returns an arbitrary implementation for concurrent hash maps.

Parameters:
ak - An arbitrary implementation for the type over which the concurrent hash map's keys are defined.
av - An arbitrary implementation for the type over which the concurrent hash map's values are defined.
Returns:
An arbitrary implementation for concurrent hash maps.

arbConcurrentLinkedQueue

public static <A> Arbitrary<ConcurrentLinkedQueue<A>> arbConcurrentLinkedQueue(Arbitrary<A> aa)
Returns an arbitrary implementation for concurrent linked queues.

Parameters:
aa - An arbitrary implementation for the type over which the concurrent linked queue is defined.
Returns:
An arbitrary implementation for concurrent linked queues.

arbCopyOnWriteArrayList

public static <A> Arbitrary<CopyOnWriteArrayList<A>> arbCopyOnWriteArrayList(Arbitrary<A> aa)
Returns an arbitrary implementation for copy-on-write array lists.

Parameters:
aa - An arbitrary implementation for the type over which the copy-on-write array list is defined.
Returns:
An arbitrary implementation for copy-on-write array lists.

arbCopyOnWriteArraySet

public static <A> Arbitrary<CopyOnWriteArraySet<A>> arbCopyOnWriteArraySet(Arbitrary<A> aa)
Returns an arbitrary implementation for copy-on-write array sets.

Parameters:
aa - An arbitrary implementation for the type over which the copy-on-write array set is defined.
Returns:
An arbitrary implementation for copy-on-write array sets.

arbDelayQueue

public static <A extends Delayed> Arbitrary<DelayQueue<A>> arbDelayQueue(Arbitrary<A> aa)
Returns an arbitrary implementation for delay queues.

Parameters:
aa - An arbitrary implementation for the type over which the delay queue is defined.
Returns:
An arbitrary implementation for delay queues.

arbLinkedBlockingQueue

public static <A> Arbitrary<LinkedBlockingQueue<A>> arbLinkedBlockingQueue(Arbitrary<A> aa)
Returns an arbitrary implementation for linked blocking queues.

Parameters:
aa - An arbitrary implementation for the type over which the linked blocking queue is defined.
Returns:
An arbitrary implementation for linked blocking queues.

arbPriorityBlockingQueue

public static <A> Arbitrary<PriorityBlockingQueue<A>> arbPriorityBlockingQueue(Arbitrary<A> aa)
Returns an arbitrary implementation for priority blocking queues.

Parameters:
aa - An arbitrary implementation for the type over which the priority blocking queue is defined.
Returns:
An arbitrary implementation for priority blocking queues.

arbSynchronousQueue

public static <A> Arbitrary<SynchronousQueue<A>> arbSynchronousQueue(Arbitrary<A> aa)
Returns an arbitrary implementation for priority blocking queues.

Parameters:
aa - An arbitrary implementation for the type over which the priority blocking queue is defined.
Returns:
An arbitrary implementation for priority blocking queues.

arbP1

public static <A> Arbitrary<P1<A>> arbP1(Arbitrary<A> aa)
Returns an arbitrary implementation for product-1 values.

Parameters:
aa - An arbitrary implementation for the type over which the product-1 is defined.
Returns:
An arbitrary implementation for product-1 values.

arbP2

public static <A,B> Arbitrary<P2<A,B>> arbP2(Arbitrary<A> aa,
                                             Arbitrary<B> ab)
Returns an arbitrary implementation for product-2 values.

Parameters:
aa - An arbitrary implementation for one of the types over which the product-2 is defined.
ab - An Arbitrary implementation for one of the types over which the product-2 is defined.
Returns:
An arbitrary implementation for product-2 values.

arbP3

public static <A,B,C> Arbitrary<P3<A,B,C>> arbP3(Arbitrary<A> aa,
                                                 Arbitrary<B> ab,
                                                 Arbitrary<C> ac)
Returns an arbitrary implementation for product-3 values.

Parameters:
aa - An arbitrary implementation for one of the types over which the product-3 is defined.
ab - An Arbitrary implementation for one of the types over which the product-3 is defined.
ac - An arbitrary implementation for one of the types over which the product-3 is defined.
Returns:
An arbitrary implementation for product-3 values.

arbP4

public static <A,B,C,D> Arbitrary<P4<A,B,C,D>> arbP4(Arbitrary<A> aa,
                                                     Arbitrary<B> ab,
                                                     Arbitrary<C> ac,
                                                     Arbitrary<D> ad)
Returns an arbitrary implementation for product-4 values.

Parameters:
aa - An arbitrary implementation for one of the types over which the product-4 is defined.
ab - An Arbitrary implementation for one of the types over which the product-4 is defined.
ac - An arbitrary implementation for one of the types over which the product-4 is defined.
ad - An arbitrary implementation for one of the types over which the product-4 is defined.
Returns:
An arbitrary implementation for product-4 values.

arbP5

public static <A,B,C,D,E> Arbitrary<P5<A,B,C,D,E>> arbP5(Arbitrary<A> aa,
                                                         Arbitrary<B> ab,
                                                         Arbitrary<C> ac,
                                                         Arbitrary<D> ad,
                                                         Arbitrary<E> ae)
Returns an arbitrary implementation for product-5 values.

Parameters:
aa - An arbitrary implementation for one of the types over which the product-5 is defined.
ab - An Arbitrary implementation for one of the types over which the product-5 is defined.
ac - An arbitrary implementation for one of the types over which the product-5 is defined.
ad - An arbitrary implementation for one of the types over which the product-5 is defined.
ae - An arbitrary implementation for one of the types over which the product-5 is defined.
Returns:
An arbitrary implementation for product-5 values.

arbP6

public static <A,B,C,D,E,F$> Arbitrary<P6<A,B,C,D,E,F$>> arbP6(Arbitrary<A> aa,
                                                               Arbitrary<B> ab,
                                                               Arbitrary<C> ac,
                                                               Arbitrary<D> ad,
                                                               Arbitrary<E> ae,
                                                               Arbitrary<F$> af)
Returns an arbitrary implementation for product-6 values.

Parameters:
aa - An arbitrary implementation for one of the types over which the product-6 is defined.
ab - An Arbitrary implementation for one of the types over which the product-6 is defined.
ac - An arbitrary implementation for one of the types over which the product-6 is defined.
ad - An arbitrary implementation for one of the types over which the product-6 is defined.
ae - An arbitrary implementation for one of the types over which the product-6 is defined.
af - An arbitrary implementation for one of the types over which the product-7 is defined.
Returns:
An arbitrary implementation for product-6 values.

arbP7

public static <A,B,C,D,E,F$,G> Arbitrary<P7<A,B,C,D,E,F$,G>> arbP7(Arbitrary<A> aa,
                                                                   Arbitrary<B> ab,
                                                                   Arbitrary<C> ac,
                                                                   Arbitrary<D> ad,
                                                                   Arbitrary<E> ae,
                                                                   Arbitrary<F$> af,
                                                                   Arbitrary<G> ag)
Returns an arbitrary implementation for product-7 values.

Parameters:
aa - An arbitrary implementation for one of the types over which the product-7 is defined.
ab - An Arbitrary implementation for one of the types over which the product-7 is defined.
ac - An arbitrary implementation for one of the types over which the product-7 is defined.
ad - An arbitrary implementation for one of the types over which the product-7 is defined.
ae - An arbitrary implementation for one of the types over which the product-7 is defined.
af - An arbitrary implementation for one of the types over which the product-7 is defined.
ag - An arbitrary implementation for one of the types over which the product-8 is defined.
Returns:
An arbitrary implementation for product-7 values.

arbP8

public static <A,B,C,D,E,F$,G,H> Arbitrary<P8<A,B,C,D,E,F$,G,H>> arbP8(Arbitrary<A> aa,
                                                                       Arbitrary<B> ab,
                                                                       Arbitrary<C> ac,
                                                                       Arbitrary<D> ad,
                                                                       Arbitrary<E> ae,
                                                                       Arbitrary<F$> af,
                                                                       Arbitrary<G> ag,
                                                                       Arbitrary<H> ah)
Returns an arbitrary implementation for product-8 values.

Parameters:
aa - An arbitrary implementation for one of the types over which the product-8 is defined.
ab - An Arbitrary implementation for one of the types over which the product-8 is defined.
ac - An arbitrary implementation for one of the types over which the product-8 is defined.
ad - An arbitrary implementation for one of the types over which the product-8 is defined.
ae - An arbitrary implementation for one of the types over which the product-8 is defined.
af - An arbitrary implementation for one of the types over which the product-8 is defined.
ag - An arbitrary implementation for one of the types over which the product-8 is defined.
ah - An arbitrary implementation for one of the types over which the product-8 is defined.
Returns:
An arbitrary implementation for product-8 values.

Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg

This software is released under an open source BSD licence.