@Test public void noPolicy() { assertFalse(new OptimizationRuler(OptimizationPolicy.NO).apply(mock(PDDocument.class))); }
@Override public Boolean apply(PDDocument document) { if (policy == OptimizationPolicy.YES) { return true; } if (policy == OptimizationPolicy.AUTO) { return willNeedOptimization(document); } return false; }
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; } }
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; } OptimizationRuler(OptimizationPolicy policy); }
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; } OptimizationRuler(OptimizationPolicy policy); @Override Boolean apply(PDDocument document); }
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; } OptimizationRuler(OptimizationPolicy policy); @Override Boolean apply(PDDocument document);  }