IDEA-176977 EnumSet.of().stream() can be simplified to Stream.of()

This commit is contained in:
Tagir Valeev
2017-08-10 15:16:15 +07:00
parent abf863309a
commit 610882b62b
6 changed files with 139 additions and 1 deletions
@@ -0,0 +1,22 @@
// "Fix all 'Simplify stream API call chains' problems in file" "false"
import java.util.EnumSet;
import java.util.List;
import static java.util.stream.Collectors.toList;
public class Tests {
interface HasCode {
default String getCode() {return this.toString();}
}
enum Status implements HasCode {
Approved, Pending, Stored
}
void test() {
List<String> list = EnumSet.of().st<caret>ream()
.map(HasCode::getCode).collect(toList());
}
}