public void testGetProjectIdsWithUnknownCategory() {
    expect(ctx.getLoggedInUser()).andReturn(mockUser);
    expect(proj.getProjectObjectsFromProjectCategory(555L))
        .andReturn(Collections.<Project>emptyList());
    EasyMock.replay(ctx, prms, proj);

    ProjectsAndCategoriesHelper helper = new DefaultProjectsAndCategoriesHelper(proj, prms, ctx);

    Set<Long> ids = helper.getProjectIds("cat555");
    assertEquals(0, ids.size());
  }
  public void testGetProjectIds() {
    expect(ctx.getLoggedInUser()).andReturn(mockUser);
    Project project = createNiceMock(Project.class);
    expect(project.getId()).andReturn(666L);
    Project project2 = createNiceMock(Project.class);
    expect(project2.getId()).andReturn(323L);
    expect(proj.getProjectObj(666L)).andReturn(project);
    expect(proj.getProjectObj(323L)).andReturn(project2);
    expect(prms.hasPermission(Permissions.BROWSE, project, mockUser)).andReturn(true);
    expect(prms.hasPermission(Permissions.BROWSE, project2, mockUser)).andReturn(true);

    expect(proj.getProjectObjectsFromProjectCategory(555L)).andReturn(Arrays.asList(project2));

    EasyMock.replay(ctx, prms, proj, project, project2);

    ProjectsAndCategoriesHelper helper = new DefaultProjectsAndCategoriesHelper(proj, prms, ctx);

    Set<Long> ids = helper.getProjectIds("666|cat555");
    assertNotNull(ids);
    assertEquals(1, ids.size());
  }