!841 【6.x】去掉transform

Merge pull request !841 from 阿超/v6-dev
This commit is contained in:
Looly
2022-10-22 08:52:31 +00:00
committed by Gitee
7 changed files with 4 additions and 73 deletions

View File

@@ -97,12 +97,6 @@ public class AbstractEnhancedWrappedStreamTest {
}, toZip);
}
@Test
public void testTransform() {
final List<Integer> list = wrap(1, 2, 3).transform(Wrapper::toList).orElse(null);
Assert.assertEquals(asList(1, 2, 3), list);
}
@Test
public void testFindFirst() {
final List<Integer> list = asList(1, 2, 3);
@@ -181,6 +175,7 @@ public class AbstractEnhancedWrappedStreamTest {
final List<Integer> list = asList(1, 2, 3);
final Map<Boolean, List<Integer>> map = new HashMap<Boolean, List<Integer>>() {
private static final long serialVersionUID = 1L;
{
put(Boolean.TRUE, singletonList(2));
put(Boolean.FALSE, asList(1, 3));
@@ -624,6 +619,7 @@ public class AbstractEnhancedWrappedStreamTest {
public void testToEntries() {
final Map<Integer, Integer> expect = new HashMap<Integer, Integer>() {
private static final long serialVersionUID = 1L;
{
put(1, 1);
put(2, 2);
@@ -704,18 +700,6 @@ public class AbstractEnhancedWrappedStreamTest {
return new Wrapper<>(source);
}
/**
* 转换为子类实现
*
* @param stream 流
* @return 子类实现
*/
@Override
public Wrapper<T> transform(final Stream<T> stream) {
this.stream = stream;
return this;
}
}
@Setter

View File

@@ -556,13 +556,4 @@ public class EasyStreamTest {
}
}
@Test
public void testTransform() {
final boolean result = EasyStream.of(1, 2, 3)
.transform(EasyStream::toList)
.map(List::isEmpty)
.orElse(false);
Assert.assertFalse(result);
}
}