WordTemplateRepository implements TemplateRepository { @Override public <E> Template<E> unlock(Template<E> template) { PersistentTemplate unwrapped = unwrap(template); unwrapped.unlock(); unwrapped = update(unwrapped); return new WordTemplate<E>(unwrapped, contextFactory); } WordTemplateRepository();  WordTemplateRepository(EntityManager em, TemplateContextFactory contextFactory); void setFileStore(FileStore fileStore); @Override TemplateQuery queryTemplates(); @Override Template<Object> getTemplate(String documentName, String language); @Override Template<E> getTemplate(String documentName, String language,
			Class<? extends E> inputType); @Override Template<E> lockForEdit(Template<E> aTemplate, User user); @Override Template<E> unlock(Template<E> template); @Override Template<E> persist(Template<E> toPersist); @Override void delete(Template<?> template); @Transactional List<Template<Object>> execute(WordTemplateQuery query);  }
@Test @Transactional public void unlock() { WordTemplate<?> template = lockedTemplate(); Template<?> unlocked = repository.unlock(template); assertNull(unlocked.getLockingUser()); assertTrue(isVersionIncontext(unlocked)); }