Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/main/java/org/cactoos/iterable/Joined.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,15 @@ public Joined(final Iterable<? extends Iterable<? extends T>> items) {
)
);
}

/**
* Ctor.
* @param item Item to be appended to end of Iterable
* @param items Iterable
* @since 0.65
*/
@SuppressWarnings("unchecked")
public Joined(final Iterable<? extends T> items, final T... item) {
this(new IterableOf<>(items, new IterableOf<>(item)));
}
}
13 changes: 13 additions & 0 deletions src/test/java/org/cactoos/iterable/JoinedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,17 @@ void joinItemAndIterable() {
).affirm();
}

@Test
@SuppressWarnings("unchecked")
void joinIterableAndItem() {
new Assertion<>(
"Must join item and iterable",
new Joined<>(
new IterableOf<>(1, 2, 3),
4, 5
),
new IsEqual<>(new IterableOf<>(1, 2, 3, 4, 5))
).affirm();
}

}