void (String[] args) { final Provider provider = new Provider(); final Optional<Result> result = provider.doWork(() -> { if (args.length > 1) { return Optional.of(new ResultImpl()); } else { return Optional.of(new ResultImpl()); } }); }