### Question:
SavedSearch implements Serializable { public void setGlobal(boolean global) { this.global = global; } protected  SavedSearch();  SavedSearch(SearchSubsystem context, String name, String pattern, Subject subject); Integer getId(); void setId(Integer id); SearchSubsystem getSearchSubsystem(); String getName(); void setName(String name); String getDescription(); void setDescription(String description); String getPattern(); void setPattern(String pattern); long getLastComputeTime(); void setLastComputeTime(long lastComputeTime); Long getResultCount(); void setResultCount(Long resultCount); Subject getSubject(); int getSubjectId(); boolean isGlobal(); void setGlobal(boolean global); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test(groups = "integration.ejb3") public void testInsert() throws Exception { getTransactionManager().begin(); EntityManager entityMgr = getEntityManager(); try { Subject subject = new Subject("searcher", true, true); entityMgr.persist(subject); SavedSearch search = new SavedSearch(SearchSubsystem.RESOURCE, "test search", "test pattern", subject); search.setGlobal(true); entityMgr.persist(search); entityMgr.flush(); } finally { getTransactionManager().rollback(); } }