fork(3) download
  1. import java.util.function.Supplier;
  2. import java.util.IdentityHashMap;
  3.  
  4. class Ideone {
  5. public static void main (final String[] args) {
  6. final IdentityHashMap<Object, Object> lambdas = new IdentityHashMap<>();
  7. for (int i = 0; i < 3; ++i) {
  8. lambdas.put((Supplier<Object>) (() -> new Object()), "one-one-one");
  9. lambdas.put((Supplier<Object>) (() -> new Object()), "two-two-two");
  10. }
  11. System.out.println(lambdas);
  12. }
  13. }
Success #stdin #stdout 0.23s 320704KB
stdin
Standard input is empty
stdout
{Ideone$$Lambda$1/19700505@1b3ebeb=one-one-one, Ideone$$Lambda$2/9195351@18025c=two-two-two}