diff --git a/src/main/java/org/springframework/hateoas/Resources.java b/src/main/java/org/springframework/hateoas/Resources.java index c3f87c14..c0ad1816 100644 --- a/src/main/java/org/springframework/hateoas/Resources.java +++ b/src/main/java/org/springframework/hateoas/Resources.java @@ -53,7 +53,7 @@ public class Resources extends ResourceSupport implements Iterable { * @param content must not be {@literal null}. * @param links the links to be added to the {@link Resources}. */ - public Resources(Collection content, Link... links) { + public Resources(Iterable content, Link... links) { this(content, Arrays.asList(links)); } @@ -63,12 +63,15 @@ public class Resources extends ResourceSupport implements Iterable { * @param content must not be {@literal null}. * @param links the links to be added to the {@link Resources}. */ - public Resources(Collection content, Iterable links) { + public Resources(Iterable content, Iterable links) { Assert.notNull(content); this.content = new ArrayList(); - this.content.addAll(content); + + for (T element : content) { + this.content.add(element); + } this.add(links); }