Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Feb 28, 2018
2 parents 7f62260 + 078c2fc commit c6c5ad2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 155 deletions.
32 changes: 0 additions & 32 deletions src/main/java/org/cactoos/scalar/And.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/
package org.cactoos.scalar;

import java.util.Iterator;
import org.cactoos.Func;
import org.cactoos.Proc;
import org.cactoos.Scalar;
Expand Down Expand Up @@ -88,17 +87,6 @@ public <X> And(final Func<X, Boolean> func, final X... src) {
this(func, new IterableOf<>(src));
}

/**
* Ctor.
* @param src The iterable
* @param proc Proc to use
* @param <X> Type of items in the iterable
* @since 0.24
*/
public <X> And(final Proc<X> proc, final Iterator<X> src) {
this(new FuncOf<>(proc, true), src);
}

/**
* Ctor.
* @param src The iterable
Expand All @@ -110,17 +98,6 @@ public <X> And(final Proc<X> proc, final Iterable<X> src) {
this(new FuncOf<>(proc, true), src);
}

/**
* Ctor.
* @param src The iterable
* @param func Func to map
* @param <X> Type of items in the iterable
* @since 0.24
*/
public <X> And(final Func<X, Boolean> func, final Iterator<X> src) {
this(func, new IterableOf<>(src));
}

/**
* Ctor.
* @param src The iterable
Expand All @@ -145,15 +122,6 @@ public And(final Scalar<Boolean>... src) {
this(new IterableOf<>(src));
}

/**
* Ctor.
* @param src The iterable
* @since 0.24
*/
public And(final Iterator<Scalar<Boolean>> src) {
this(new IterableOf<>(src));
}

/**
* Ctor.
* @param src The iterable
Expand Down
65 changes: 0 additions & 65 deletions src/main/java/org/cactoos/scalar/AndInThreads.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
package org.cactoos.scalar;

import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
Expand Down Expand Up @@ -102,16 +101,6 @@ public <X> AndInThreads(final Func<X, Boolean> func, final X... src) {
this(func, new IterableOf<>(src));
}

/**
* Ctor.
* @param src The iterable
* @param proc Proc to use
* @param <X> Type of items in the iterable
*/
public <X> AndInThreads(final Proc<X> proc, final Iterator<X> src) {
this(new FuncOf<>(proc, true), src);
}

/**
* Ctor.
* @param src The iterable
Expand All @@ -122,17 +111,6 @@ public <X> AndInThreads(final Proc<X> proc, final Iterable<X> src) {
this(new FuncOf<>(proc, true), src);
}

/**
* Ctor.
* @param src The iterable
* @param func Func to map
* @param <X> Type of items in the iterable
*/
public <X> AndInThreads(final Func<X, Boolean> func,
final Iterator<X> src) {
this(func, new IterableOf<>(src));
}

/**
* Ctor.
* @param src The iterable
Expand All @@ -157,15 +135,6 @@ public AndInThreads(final Scalar<Boolean>... src) {
this(new IterableOf<>(src));
}

/**
* Ctor.
* @param src The iterable
* @since 0.24
*/
public AndInThreads(final Iterator<Scalar<Boolean>> src) {
this(new IterableOf<>(src));
}

/**
* Ctor.
* @param src The iterable
Expand Down Expand Up @@ -200,18 +169,6 @@ public <X> AndInThreads(final ExecutorService svc,
this(svc, func, new IterableOf<>(src));
}

/**
* Ctor.
* @param svc Executable service to run thread in
* @param src The iterable
* @param proc Proc to use
* @param <X> Type of items in the iterable
*/
public <X> AndInThreads(final ExecutorService svc,
final Proc<X> proc, final Iterator<X> src) {
this(svc, new FuncOf<>(proc, true), src);
}

/**
* Ctor.
* @param svc Executable service to run thread in
Expand All @@ -224,18 +181,6 @@ public <X> AndInThreads(final ExecutorService svc,
this(svc, new FuncOf<>(proc, true), src);
}

/**
* Ctor.
* @param svc Executable service to run thread in
* @param src The iterable
* @param func Func to map
* @param <X> Type of items in the iterable
*/
public <X> AndInThreads(final ExecutorService svc,
final Func<X, Boolean> func, final Iterator<X> src) {
this(svc, func, new IterableOf<>(src));
}

/**
* Ctor.
* @param svc Executable service to run thread in
Expand Down Expand Up @@ -264,16 +209,6 @@ public AndInThreads(final ExecutorService svc,
this(svc, new IterableOf<>(src));
}

/**
* Ctor.
* @param svc Executable service to run thread in
* @param src The iterable
*/
public AndInThreads(final ExecutorService svc,
final Iterator<Scalar<Boolean>> src) {
this(svc, new IterableOf<>(src));
}

/**
* Ctor.
* @param svc Executable service to run thread in
Expand Down
58 changes: 0 additions & 58 deletions src/test/java/org/cactoos/scalar/AndInThreadsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,21 +169,6 @@ public void worksWithFunc() throws Exception {
);
}

@Test
public void worksWithProcIterator() throws Exception {
final List<Integer> list = Collections.synchronizedList(
new ArrayList<Integer>(2)
);
new AndInThreads(
new Proc.NoNulls<Integer>(list::add),
Arrays.asList(1, 2).iterator()
).value();
MatcherAssert.assertThat(
list,
Matchers.containsInAnyOrder(1, 2)
);
}

@Test
public void worksWithProcIterable() throws Exception {
final List<Integer> list = Collections.synchronizedList(
Expand All @@ -199,19 +184,6 @@ public void worksWithProcIterable() throws Exception {
);
}

@Test
public void worksWithIteratorScalarBoolean() throws Exception {
MatcherAssert.assertThat(
new AndInThreads(
new ListOf<Scalar<Boolean>>(
new Constant<Boolean>(true),
new Constant<Boolean>(false)
).iterator()
).value(),
Matchers.equalTo(false)
);
}

@Test
public void worksWithIterableScalarBoolean() throws Exception {
MatcherAssert.assertThat(
Expand Down Expand Up @@ -242,22 +214,6 @@ public void worksWithExecServiceProcValues() throws Exception {
);
}

@Test
public void worksWithExecServiceProcIterator() throws Exception {
final List<Integer> list = Collections.synchronizedList(
new ArrayList<Integer>(2)
);
new AndInThreads(
Executors.newSingleThreadExecutor(),
new Proc.NoNulls<Integer>(list::add),
Arrays.asList(1, 2).iterator()
).value();
MatcherAssert.assertThat(
list,
Matchers.containsInAnyOrder(1, 2)
);
}

@Test
public void worksWithExecServiceProcIterable() throws Exception {
final List<Integer> list = Collections.synchronizedList(
Expand Down Expand Up @@ -301,20 +257,6 @@ public void worksWithExecServiceIterableScalarBoolean() throws Exception {
);
}

@Test
public void worksWithExecServiceIteratorScalarBoolean() throws Exception {
MatcherAssert.assertThat(
new AndInThreads(
Executors.newSingleThreadExecutor(),
new ListOf<Scalar<Boolean>>(
new Constant<Boolean>(true),
new Constant<Boolean>(true)
).iterator()
).value(),
Matchers.equalTo(true)
);
}

@Test
public void worksWithEmptyIterableScalarBoolean() throws Exception {
MatcherAssert.assertThat(
Expand Down

0 comments on commit c6c5ad2

Please sign in to comment.