Skip to content

Instantly share code, notes, and snippets.

@timyates
Last active October 14, 2015 20:28
Embed
What would you like to do?
package com.bloidonia.meddling;
@FunctionalInterface
public interface Source<T> {
default void yield(T value) {
System.out.println(value);
}
default void run() {
apply(this);
}
void apply(Source<T> s);
static void main(String[] args) {
Source<Integer> intSource = (self) -> {
self.yield(1);
self.yield(2);
self.yield(3);
};
intSource.run();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment