@Test
 public void convertShouldReturnSuppliedId() {
   ProjectIdWriteConverter converter = new ProjectIdWriteConverter();
   String suppliedId = UUID.randomUUID().toString();
   ProjectId projectId = ProjectId.get(suppliedId);
   String convertedId = converter.convert(projectId);
   assertEquals(suppliedId, convertedId);
 }
 private static ProjectDetails createProjectDetailsFromProjectInstance(
     ProjectInstance projectInstance) {
   final ProjectId projectId = ProjectId.get(projectInstance.getName());
   final String description = projectInstance.getDescription();
   final User projectOwner = projectInstance.getOwner();
   final UserId ownerId =
       projectOwner != null ? UserId.getUserId(projectOwner.getName()) : UserId.getGuest();
   final boolean inTrash = isInTrash(projectInstance);
   final Slot displayNameSlot =
       projectInstance.getProtegeInstance().getKnowledgeBase().getSlot("displayName");
   final String displayName =
       (String) projectInstance.getProtegeInstance().getOwnSlotValue(displayNameSlot);
   return new ProjectDetails(projectId, displayName, description, ownerId, inTrash);
 }
 public synchronized Set<ProjectId> getProjects() {
   try {
     READ_LOCK.lock();
     MetaProject metaProject = getMetaProject();
     Set<ProjectInstance> projectInstances = metaProject.getProjects();
     Set<ProjectId> result = new HashSet<ProjectId>(projectInstances.size());
     for (ProjectInstance pi : projectInstances) {
       String projectName = pi.getName();
       result.add(ProjectId.get(projectName));
     }
     return result;
   } finally {
     READ_LOCK.unlock();
   }
 }
 public List<ProjectDetails> getListableReadableProjects(UserId userId) {
   Policy policy = metaproject.getPolicy();
   User user = policy.getUserByName(userId.getUserName());
   List<ProjectDetails> result = new ArrayList<ProjectDetails>();
   for (ProjectInstance projectInstance : metaproject.getProjects()) {
     final String name = projectInstance.getName();
     if (name != null && ProjectId.isWelFormedProjectId(name)) {
       final ProjectId projectId = ProjectId.get(name);
       if (isAuthorisedToReadAndList(policy, user, projectInstance)) {
         OWLAPIProjectDocumentStore ds =
             OWLAPIProjectDocumentStore.getProjectDocumentStore(projectId);
         if (ds.exists()) {
           final ProjectDetails projectDetails =
               createProjectDetailsFromProjectInstance(projectInstance);
           result.add(projectDetails);
         }
       }
     }
   }
   return result;
 }