class DelegateOnGetter { private final java.util.concurrent.atomic.AtomicReference> bar = new java.util.concurrent.atomic.AtomicReference>(); private interface Bar { void setList(java.util.ArrayList list); int getInt(); } @java.lang.SuppressWarnings("all") public Bar getBar() { java.util.concurrent.atomic.AtomicReference value = this.bar.get(); if (value == null) { synchronized (this.bar) { value = this.bar.get(); if (value == null) { value = new java.util.concurrent.atomic.AtomicReference(new Bar(){ public void setList(java.util.ArrayList list) { } public int getInt() { return 42; } }); this.bar.set(value); } } } return value.get(); } @java.lang.SuppressWarnings("all") public void setList(final java.util.ArrayList list) { this.getBar().setList(list); } @java.lang.SuppressWarnings("all") public int getInt() { return this.getBar().getInt(); } }