Skip to content

Commit

Permalink
(yegor256#1252) Removed unnecessary constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
fanifieiev committed Dec 8, 2019
1 parent 8bfe277 commit 711e789
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
19 changes: 0 additions & 19 deletions src/main/java/org/cactoos/collection/Immutable.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

import java.util.Collection;
import java.util.Iterator;
import org.cactoos.iterable.IterableOf;
import org.cactoos.list.ListOf;

/**
* Collection that doesn't allow any modifications.
Expand Down Expand Up @@ -57,23 +55,6 @@ public final class Immutable<X> implements Collection<X> {
*/
private final Collection<X> col;

/**
* Ctor.
* @param src Source elements
*/
@SafeVarargs
public Immutable(final X... src) {
this(new IterableOf<>(src));
}

/**
* Ctor.
* @param src Source iterable
*/
public Immutable(final Iterable<X> src) {
this(new ListOf<X>(src));
}

/**
* Ctor.
* @param src Source collection
Expand Down
5 changes: 2 additions & 3 deletions src/test/java/org/cactoos/collection/ImmutableTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/
package org.cactoos.collection;

import org.cactoos.iterable.IterableOf;
import org.cactoos.list.ListOf;
import org.hamcrest.core.IsEqual;
import org.junit.Test;
Expand Down Expand Up @@ -109,7 +108,7 @@ public void testToArray() {
new Assertion<>(
"toArray(T[]) must be equals to original",
new Immutable<>(
1, 2, 3
new ListOf<>(1, 2, 3)
).toArray(new Integer[3]),
new IsEqual<>(
new ListOf<>(1, 2, 3).toArray(new Integer[3])
Expand All @@ -122,7 +121,7 @@ public void add() {
new Assertion<>(
"add() must throw exception",
() -> new Immutable<>(
new IterableOf<>(1, 2)
new ListOf<>(1, 2)
).add(3),
new Throws<>(
new MatcherOf<>(
Expand Down

0 comments on commit 711e789

Please sign in to comment.