| // Copyright (c) 2022, the R8 project authors. Please see the AUTHORS file |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| public class NestLambda { |
| private void print(Object o) { |
| System.out.println("printed: " + o); |
| // Avoids java.util.Consumer to run below on Apis below 24. |
| interface ThisConsumer<T> { |
| class Inner implements Itf { |
| void exec(ThisConsumer<String> consumer) { |
| consumer.accept("inner"); |
| exec(NestLambda.this::print); |
| private void printItf(Object o) { |
| System.out.println("printed from itf: " + o); |
| void exec(ThisConsumer<String> consumer) { |
| void execItfLambda(Itf itf) { |
| public static void main(String[] args) { |
| new NestLambda().getInner().execLambda(); |
| new NestLambda().execItfLambda(new Itf() {}); |