Skip to content

Instantly share code, notes, and snippets.

@jeffbowman
Last active August 29, 2015 14:01
Show Gist options
  • Save jeffbowman/2ab627ac865b8bc799a9 to your computer and use it in GitHub Desktop.
Save jeffbowman/2ab627ac865b8bc799a9 to your computer and use it in GitHub Desktop.
ConfluexBlogSupplierExample2
class MyIndex implements Supplier<Integer> {
private int index = 0;
@Override
public Integer get() {
return index++;
}
}
MyIndex i = new MyIndex();
i.get(); // --> 0
i.get(); // --> 1
i.get(); // --> 2 ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment