/** {@inheritDoc} */ @Override public void toggleBranchSubscription(Branch branch) { JCUser current = userService.getCurrentUser(); if (branch.getSubscribers().contains(current)) { branch.getSubscribers().remove(current); } else { branch.getSubscribers().add(current); } branchDao.update(branch); }
private Branch createBranch() { Branch branch = new Branch("branch name", "branch description"); branch.setId(1L); branch.setUuid("uuid"); return branch; }