class OptimizationRuler implements Function<PDDocument, Boolean> {

    @Override
    public Boolean apply(PDDocument document) {
        if (policy == OptimizationPolicy.YES) {
            return true;
        }
        if (policy == OptimizationPolicy.AUTO) {
            return willNeedOptimization(document);
        }
        return false;
    }

    public  OptimizationRuler(OptimizationPolicy policy);

}