src/main/java/de/digitalcollections/iiif/model/search/SearchResult.java
@JsonDeserialize(contentAs = SearchLayer.class)
  @Override
  public void setWithin(List<Resource> within) throws IllegalArgumentException {
    if (within.stream().anyMatch(r -> !(r instanceof SearchLayer))) {
      throw new IllegalArgumentException("SearchResult can only be within a SearchLayer.");
    }
    super.setWithin(within);
  }
@JsonDeserialize(contentAs = SearchLayer.class)
  @Override
  public void setWithin(List<Resource> within) throws IllegalArgumentException {
    if (within.stream().anyMatch(r -> !(r instanceof SearchLayer))) {
      throw new IllegalArgumentException("SearchResult can only be within a SearchLayer.");
    }
    super.setWithin(within);
  }
Set the list of containing resources. Must all be instances of {@link SearchLayer}

@throws IllegalArgumentException if at least one of the resources is not a {@link SearchLayer}