### Question:
MongoDbUser extends UserImpl { @Override public PageLayout getDefaultPageLayout() { PageLayout layout = super.getDefaultPageLayout(); if (layout == null) { layout = pageLayoutRepository.getByPageLayoutCode(super.getDefaultPageLayoutCode()); super.setDefaultPageLayout(layout); } return layout; } MongoDbUser(String id);  MongoDbUser(); List<String> getAuthorityCodes(); PageLayoutRepository getPageLayoutRepository(); void setAuthorityCodes(List<String> authorityCodes); List<MongoDbPersonAssociation> getFriends(); void setFriends(List<MongoDbPersonAssociation> friends); @Override void setAuthorities(Collection<Authority> authorities); @Override Collection<GrantedAuthority> getAuthorities(); @Override void addAuthority(Authority authority); @Override void removeAuthority(Authority authority); @Override PageLayout getDefaultPageLayout(); @Override boolean equals(Object o); @Override int hashCode(); void setPageLayoutRepository(PageLayoutRepository pageLayoutRepository);  }### Answer:
@Test public void getDefaultPageLayout_Valid(){ PageLayout layout = new PageLayoutImpl(); user.setDefaultPageLayoutCode("dingus"); expect(pageLayoutRepository.getByPageLayoutCode("dingus")).andReturn(layout); replay(pageLayoutRepository); assertThat(user.getDefaultPageLayout(), is(sameInstance(layout))); }
@Test public void getDefaultPageLayout_Null(){ PageLayout layout = new PageLayoutImpl(); user.setDefaultPageLayout(layout); assertThat(layout, is(sameInstance(user.getDefaultPageLayout()))); }