ViewerPreferencesUtils { public static DUPLEX getDuplex(PdfDuplex duplex) { return DUPLEX_CACHE.get(duplex); } private  ViewerPreferencesUtils(); static NON_FULL_SCREEN_PAGE_MODE getNFSMode(PdfNonFullScreenPageMode nfsMode); static PageMode getPageMode(PdfPageMode mode); static PageLayout getPageLayout(PdfPageLayout layout); static READING_DIRECTION getDirection(PdfDirection direction); static DUPLEX getDuplex(PdfDuplex duplex); static PRINT_SCALING getPrintScaling(PdfPrintScaling scaling); static void setBooleanPreferences(PDViewerPreferences preferences, Set<PdfBooleanPreference> enabled);  }
@Test public void testGetDuplex() { assertEquals(PDViewerPreferences.DUPLEX.Simplex, ViewerPreferencesUtils.getDuplex(PdfDuplex.SIMPLEX)); assertEquals(PDViewerPreferences.DUPLEX.DuplexFlipLongEdge, ViewerPreferencesUtils.getDuplex(PdfDuplex.DUPLEX_FLIP_LONG_EDGE)); assertEquals(PDViewerPreferences.DUPLEX.DuplexFlipShortEdge, ViewerPreferencesUtils.getDuplex(PdfDuplex.DUPLEX_FLIP_SHORT_EDGE)); }