你需要使用 BooleanSupplier。 https://docs.oracle.com/javase/8/docs/api/java/util/function/BooleanSupplier.html