This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static it.fago.experiments.EderChallenge.Operation.from; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Optional; | |
public class EderChallenge { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package it.fago.experiment.autocloseable.dirty; | |
import java.util.function.BiFunction; | |
import java.util.function.Consumer; | |
public class AutoCloser{ | |
public static final <S> AutoCloseable autoclose(S element, Consumer<S> elementInvocation) { | |
return ((BiFunction<S, Consumer<S>, AutoCloseable>) (subject, callback) -> () -> callback.accept(subject)).apply(element, elementInvocation); | |
} |
NewerOlder