Datasets:
ArXiv:
License:
Download data/val/fank243/springboot/study-common/src/test/java/AppTest.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 676 Bytes
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/val/fank243/springboot/study-common/src/test/java/AppTest.java
- Command line
-
hf download hf://datasets/RepoFusion/Stack-Repo@bbc90aef76314892f2d54f85da32b81503fb7eb3/data/val/fank243/springboot/study-common/src/test/java/AppTest.java
-
curl -L -o AppTest.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/val/fank243/springboot/study-common/src/test/java/AppTest.java
676 Bytes
| import java.util.ArrayList; | |
| import java.util.Collections; | |
| import java.util.List; | |
| import lombok.Builder; | |
| import lombok.Data; | |
| public class AppTest { | |
| static class Tst { | |
| private String name; | |
| } | |
| public static void main(String[] args) { | |
| List<Tst> list = new ArrayList<>(); | |
| list.add(Tst.builder().name("abc").build()); | |
| list.add(Tst.builder().name("adc").build()); | |
| list.add(Tst.builder().name("bac").build()); | |
| Collections.swap(list, | |
| list.indexOf(list.stream().filter(tst -> tst.getName().equals("bac")).findFirst().orElse(list.get(0))), 0); | |
| System.out.println(list); | |
| } | |
| } | |