コード例 #1
0
 public static void main(String[] args) {
   SingletonSet<Integer> set = SingletonSet.of(1);
   for (int i = 0; i < 500_000_000; i++) {
     for (Object s : set) {
       field = s;
     }
   }
 }
コード例 #2
0
 @Setup
 public void setup(Blackhole bh) {
   arrayList = new ArrayList<>();
   arrayList.add(1);
   lambda = SingletonSet.of(1);
   lambdaBugged = SingletonSetBugged.of(1);
   ix = Ix.just(1);
   singleton = Collections.singleton(1);
   singletonList = Collections.singletonList(1);
   c = bh::consume;
 }