@Finder("search")
  @SuccessResponse(statuses = { HttpStatus.S_200_OK })
  @ParamError(code = INVALID_ID, parameterNames = { "albumId", "photoId" })
  @ParamError(code = UNSEARCHABLE_ALBUM_ID, parameterNames = { "albumId" })
  public List<AlbumEntry> search(@Optional @QueryParam("albumId") Long albumId,
                                 @Optional @QueryParam("photoId") Long photoId)
  {
    List<AlbumEntry> result = new ArrayList<>();
    for (Map.Entry<CompoundKey, AlbumEntry> entry : _db.getData().entrySet())
    {
      CompoundKey key = entry.getKey();
      // if the id is null, don't do any filtering by that id
      // (treat all values as a match)
      if (albumId != null && !key.getPart("albumId").equals(albumId))
        continue;
      if (photoId != null && !key.getPart("photoId").equals(photoId))
        continue;
      result.add(entry.getValue());
    }
    return result;
  }
@Test
  public void testSearch()
  {
    // we previously put the first 3 entries in album 1
    Set<AlbumEntry> result = new HashSet<>(_entryRes.search(Long.valueOf(1), null));
    Set<AlbumEntry> expected = new HashSet<>();
    for (int i = 0; i < 3; i++)
    {
      expected.add(_entries[i]);
    }
    Assert.assertEquals(result, expected);
  }