### Question:
JpaPageRepository implements PageRepository { @Override public Page get(String id) { return expandProperties(manager.find(JpaPage.class, Long.parseLong(id))); }  @Override Class<? extends Page> getType(); @Override Page get(String id); @Override Page save(Page item); @Override void delete(Page item); @Override List<Page> getAllPagesForUserType(String userId, String pageType); @Override List<Page> getPagesForContextType(String contextId, String pageType); @Override int deletePages(String userId, String pageType); @Override boolean hasPersonPage(String userId); @Override boolean hasPage(String contextId, String pageType); @Override List<PageUser> getPagesForUser(String userId, String pageType); @Override PageUser getSingleRecord(String userId, String pageId); @Override Page createPageForUser(User user, PageTemplate pt); @Override List<Page> getAll(); @Override List<Page> getLimitedList(int offset, int limit); @Override int getCountAll();  }### Answer:
@Test public void getById_valid_userPage() { Page p = repository.get(USER_PAGE_ID); assertThat(p, is(notNullValue())); assertThat(p.getId(), is(equalTo(USER_PAGE_ID))); assertThat(p.getPageType(), is(PageType.USER.toString().toUpperCase())); assertThat(p.getParentPage(), is(nullValue(Page.class))); assertThat(p.getSubPages().isEmpty(), is(true)); }
@Test public void getById_valid_subPagePage() { Page p = repository.get(SUB_PAGE_ID); assertThat(p, is(notNullValue())); assertThat(p.getId(), is(equalTo(SUB_PAGE_ID))); assertThat(p.getPageType(), is(PageType.SUB_PAGE.toString().toUpperCase())); assertThat(p.getParentPage(), is(notNullValue(Page.class))); assertThat(p.getSubPages().isEmpty(), is(true)); }
@Test public void getById_invalid() { Page p = repository.get("-1"); assertThat(p, is(nullValue())); }