mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-23 18:03:06 +07:00
27 lines
591 B
Java
27 lines
591 B
Java
// "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
|
|
}
|
|
|
|
enum Status2 implements HasCode {
|
|
Finished
|
|
}
|
|
|
|
void test() {
|
|
List<String> list = EnumSet.of(Status.Approved, (Status.Pending), Status.Stored, Status2.Finished).st<caret>ream()
|
|
.map(HasCode::getCode).collect(toList());
|
|
}
|
|
}
|