@Override
  public BatchResult<Long, Photo> batchGet(Set<Long> ids)
  {
    Map<Long, Photo> result = new HashMap<>();
    Map<Long, RestLiServiceException> errors =
        new HashMap<>();

    for (Long key : ids)
    {
      if (get(key) != null)
      {
        result.put(key, get(key));
      }
      else
      {
        errors.put(key, new RestLiServiceException(HttpStatus.S_404_NOT_FOUND,
                                                   "No photo with id=" + key
                                                       + " has been found."));
      }
    }
    return new BatchResult<>(result, errors);
  }
@Test
  public void testBatchGet() {
    final String[] titles = {"1","2","3"};
    final long[] ids = new long[titles.length];
    for (int i = 0; i < titles.length; i++)
      ids[i] = createPhoto(titles[i]);

    // validate all data are correct
    Set<Long> batchIds = new HashSet<>();
    batchIds.add(ids[1]);
    batchIds.add(ids[2]);
    Map<Long, Photo> batchPhotos = _res.batchGet(batchIds);

    Assert.assertEquals(batchPhotos.size(), 2);

    for (int i = 1; i < titles.length; i++) // go through {1,2}
    {
      final Photo p = batchPhotos.get(ids[i]);
      Assert.assertNotNull(p);
      Assert.assertEquals(p.getTitle(), titles[i]);
      Assert.assertEquals(p.getId().longValue(), ids[i]);
      Assert.assertTrue(p.hasExif());
      final EXIF e = p.getExif();
      Assert.assertTrue(e.hasLocation());
      final LatLong l = e.getLocation();
      Assert.assertEquals(l.getLatitude(), 7.0f);
      Assert.assertEquals(l.getLongitude(), 27.0f);
    }
  }