Skip to content

Instantly share code, notes, and snippets.

@tylertreat
Created December 31, 2014 21:23
public class FooEntity {
private BarEntity relatedEntity;
public BarEntity getRelatedEntity() {
if (relatedEntity == null)
relatedEntity = new BarEntity(); // Alternatively, this might be a database call
return relatedEntity;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment