@Override public ImmutableSet<T> findObjectsInRect(Point min, Point max) { checkArgument(min.x < max.x && min.y < max.y, "Invalid rectangle, expected 'min' < 'max', found %s and %s.", min, max); final ImmutableSet.Builder<T> builder = ImmutableSet.builder(); synchronized (objLocs) { for (final Entry<T, Point> entry : objLocs.entrySet()) { if (isInRect(min, max, entry.getValue())) { builder.add(entry.getKey()); } } } return builder.build(); }