ViewerPreferencesUtils { public static READING_DIRECTION getDirection(PdfDirection direction) { if (PdfDirection.RIGHT_TO_LEFT.equals(direction)) { return PDViewerPreferences.READING_DIRECTION.R2L; } return PDViewerPreferences.READING_DIRECTION.L2R; } 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 testGetDirection() { assertEquals(PDViewerPreferences.READING_DIRECTION.L2R, ViewerPreferencesUtils.getDirection(PdfDirection.LEFT_TO_RIGHT)); assertEquals(PDViewerPreferences.READING_DIRECTION.R2L, ViewerPreferencesUtils.getDirection(PdfDirection.RIGHT_TO_LEFT)); }