@Test public void test_invocation() { final MemoidOne<Integer, String> memoid = new MemoidOne<>((i) -> i.toString()); assertEquals("7", memoid.apply(7)); assertEquals("19", memoid.apply(19)); assertEquals("19", memoid.apply(19)); assertEquals("7", memoid.apply(7)); }
@Override public Output apply(Input input) { if (input == null) return fn_.apply(input); return match_(input) .orElseGet(() -> derive_(input)) .getOutput(); }
MemoidOne implements Function<Input, Output> { @Override public Output apply(Input input) { if (input == null) return fn_.apply(input); return match_(input) .orElseGet(() -> derive_(input)) .getOutput(); } }
MemoidOne implements Function<Input, Output> { @Override public Output apply(Input input) { if (input == null) return fn_.apply(input); return match_(input) .orElseGet(() -> derive_(input)) .getOutput(); } MemoidOne(Function<? super Input, ? extends Output> fn);  MemoidOne(Function<? super Input, ? extends Output> fn, BiPredicate<Input, Input> equality); }
MemoidOne implements Function<Input, Output> { @Override public Output apply(Input input) { if (input == null) return fn_.apply(input); return match_(input) .orElseGet(() -> derive_(input)) .getOutput(); } MemoidOne(Function<? super Input, ? extends Output> fn);  MemoidOne(Function<? super Input, ? extends Output> fn, BiPredicate<Input, Input> equality); @Override Output apply(Input input); }
MemoidOne implements Function<Input, Output> { @Override public Output apply(Input input) { if (input == null) return fn_.apply(input); return match_(input) .orElseGet(() -> derive_(input)) .getOutput(); } MemoidOne(Function<? super Input, ? extends Output> fn);  MemoidOne(Function<? super Input, ? extends Output> fn, BiPredicate<Input, Input> equality); @Override Output apply(Input input);  }