package com.sageserpent.americium.java;

import com.sageserpent.americium.Trials;
import org.junit.jupiter.api.Test;

public class TrialsApiTests {
    @Test
    void testDrivePureJavaApi() {
        final TrialsApi api = Trials.api();

        final Trials<Integer> integerTrials = api.only(1);
        final Trials<Double> doubleTrials = api.choose(new Double[]{1.2, 5.6});

        final Trials<? extends Number> alternateTrials = api.alternate(integerTrials, doubleTrials, doubleTrials);

        alternateTrials.supplyTo(number -> {
            System.out.println(number.floatValue());
        });
    }
}

@@ -111,16 +111,82 @@
 .Test;%0A%0A
+import java.math.BigDecimal;%0Aimport java.util.function.Function;%0A%0A
 public c
@@ -394,24 +394,40 @@
 ubleTrials =
+%0A               
  api.choose(
@@ -447,17 +447,435 @@
 1.2, 5.6
-%7D
+, 0.1 + 0.1 + 0.1%7D)%0A                        .map((Function%3C? super Double, Double%3E) value -%3E 10 * value);%0A        final Trials%3CBigDecimal%3E bigDecimalTrials =%0A                api.only(BigDecimal.ONE.divide(BigDecimal.TEN).add(BigDecimal.ONE.divide(BigDecimal.TEN)).add(BigDecimal.ONE.divide(BigDecimal.TEN)))%0A                        .map((Function%3C? super BigDecimal, BigDecimal%3E) value -%3E value.multiply(BigDecimal.TEN)
 );%0A%0A    
@@ -966,30 +966,34 @@
 ubleTrials, 
-double
+bigDecimal
 Trials);%0A%0A  
@@ -1076,21 +1076,8 @@
 mber
-.floatValue()
 );%0A 

Make the Java smoke test of 'TrialsApi' more interesting with an example of 'BigDecimal' versus 'Double'. This exposes a problem with the API - the Java and Scala overloads are fighting each other.