### Question:
ToolGroupManager implements SecuredEntityManager { @Override public ToolGroup loadByNameOrId(String identifier) { if (NumberUtils.isDigits(identifier)) { return load(Long.parseLong(identifier)); } else { Pair<String, String> registryAndGroupName = getPrefixAndName(identifier); List<ToolGroup> groups = toolGroupDao.loadToolGroupsByNameAndRegistryName(registryAndGroupName.getRight(), registryAndGroupName.getLeft()); Assert.isTrue(groups.size() <= 1, messageHelper.getMessage(MessageConstants.ERROR_TOO_MANY_RESULTS, identifier)); Assert.isTrue(!groups.isEmpty(), messageHelper.getMessage(MessageConstants.ERROR_TOOL_GROUP_NOT_FOUND, identifier)); ToolGroup result = groups.get(0); result.setTools(toolManager.loadToolsByGroup(result.getId())); result.setPrivateGroup(result.getName().equalsIgnoreCase(makePrivateGroupName())); return result; } }  @Transactional(propagation = Propagation.REQUIRED) ToolGroup create(final ToolGroup group); @Transactional(propagation = Propagation.REQUIRED) ToolGroup updateToolGroup(final ToolGroup toolGroup); @Transactional(propagation = Propagation.REQUIRED) ToolGroup delete(final String id, final boolean force); List<ToolGroup> loadByRegistryId(Long registryId); List<ToolGroup> loadByRegistryNameOrId(String registry); ToolGroup loadPrivate(Long registryId); ToolGroupWithIssues loadToolsWithIssuesCount(Long id); @Transactional(propagation = Propagation.REQUIRED) ToolGroup createPrivate(Long registryId); @Override ToolGroup load(Long id); @Override @Transactional(propagation = Propagation.REQUIRED) ToolGroup changeOwner(Long id, String owner); @Override AclClass getSupportedClass(); @Override ToolGroup loadByNameOrId(String identifier); @Override Integer loadTotalCount(); @Override Collection<? extends AbstractSecuredEntity> loadAllWithParents(Integer page, Integer pageSize); @Override ToolGroup loadWithParents(final Long id); ImmutablePair<String, String> getGroupAndTool(String repository); ToolGroup loadToolGroupByImage(String registry, String image); boolean doesToolGroupExist(String registryName, String groupName); boolean isGroupPrivate(ToolGroup group); static Pair<String, String> getPrefixAndName(String identifier);  }### Answer:
@Test @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) public void testLoadByNameWIthRegistry() { ToolGroup group = createToolGroup(); ToolGroup loadedGroup = toolGroupManager.loadByNameOrId(registry.getPath() + "/" + group.getName()); Assert.assertEquals(group.getId(), loadedGroup.getId()); Assert.assertEquals(group.getName(), loadedGroup.getName()); }