static Tuple2<String, Integer> f() { // Autoboxing converts the int to Integer: return new Tuple2<>("hi", 47); } static Tuple3<Amphibian, String, Integer> g() {
static Tuple4<Vehicle, Amphibian, String, Integer> h() { return new Tuple4<>( new Vehicle(), new Amphibian(), "hi", 47); } static
public static void main(String[] args) { // Returns right away: new DiningPhilosophers(5); // [4] // Keeps main() from exiting: new Nap(3, "Shutdown"); } }
public static void test(IntGenerator gp) { new TimedAbort(4, "No odd numbers discovered"); test(gp, 10); } }
static Tuple4<Vehicle, Amphibian, String, Integer> h() { return tuple( new Vehicle(), new Amphibian(), "hi", 47); } static
public void execute() { Operations.show("Bing"); } }
public static void main(String[] args) { double[] da = new double[7]; Arrays.setAll(da, new Rand.Double()::get); show(da); Arrays.setAll(da, n -> da[n] / 100); // [1] show(da); } }
public static void main(String[] args) { long[] l1 = fillCounted(20); // No problem show(l1); // On my machine, this runs out of heap space: //- long[] l2 = fillCounted(10_000_000); } }
static Tuple5<Vehicle, Amphibian, String, Integer, Double> k() { return new Tuple5<>( new Vehicle(), new Amphibian(), "hi", 47, 11.1); } public static void main(String[] args) {
public static void main(String[] args) { Operations.runOps( new Bing(), new Crack(), new Twist()); } }
@Override public Pair<Integer,String> get() { return new Pair<>(number++, "" + letter++); } }
static <T> T prepare(T ingredient) { new Nap(0.1); return ingredient; } static <T> CompletableFuture<T> prep(T ingredient) {
static Tuple5<Vehicle, Amphibian, String, Integer, Double> k() { return tuple(new Vehicle(), new Amphibian(), "hi", 47, 11.1); } public static void main(String[] args) {
public static void main(String[] args) { for(int i = 0; i < 7; i++) show(flavorSet(3)); } }
static Baked heat(Pan p) { new Nap(0.1); return new Baked(); } static CompletableFuture<Baked>
public static Tuple2<Item,Item> newPair() { return tuple(newItem(), newItem()); } }
@Override public synchronized int next() { ++currentEvenValue; new Nap(0.01); // Cause failure faster ++currentEvenValue; return currentEvenValue; } public static void main(String[] args) {
static Pan pan(Batter b) { new Nap(0.1); return new Pan(); } static Baked heat(Pan p) {
Step forward() { if(equals(BOXED)) return BOXED; new Nap(effort * 0.1); return values()[ordinal() + 1]; } }