Skip to content

Instantly share code, notes, and snippets.

View stefanofago73's full-sized avatar
💭
Software Designer, I like to build software, a little tormented soul

Stefano Fago stefanofago73

💭
Software Designer, I like to build software, a little tormented soul
View GitHub Profile
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 {
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);
}