Files
openide/java/java-tests/testData/inspection/sequencedCollectionMethod/beforeAll.java
Tagir Valeev 77d1d0ab2e [java-tests] Mock JDK 21 (downloaded from the repository); remove in-place mocks where possible
Part of IDEA-334171 Store MockJDK in artifact repository, rather than in Git

GitOrigin-RevId: 9c6214e3ead47cc164d20813f5a2b37136607213
2023-10-06 10:48:24 +00:00

29 lines
717 B
Java

// "Fix all 'SequencedCollection method can be used' problems in file" "true"
import java.util.*;
interface Foo extends SequencedCollection<String> {}
public class Test {
public static void main(Foo foo, String[] args) {
List<String> list = List.of(args);
var e1 = foo.iterator().n<caret>ext();
var e2 = list.get(0);
var e3 = list.get(list.size() - 1);
var e4 = list.remove(0);
var e5 = list.remove(list.size() - 1);
list.remove("e");
list.get(1);
}
void testAdd(List<String> list) {
list.add(0, "hello");
}
void testSeries(List<String> list) {
System.out.println(list.get(0));
System.out.println(list.get(1));
System.out.println(list.get(2));
}
}