### Question:
ITextUtil { public static String getPageSize( Rectangle rect ) { Field[] fields = PageSize.class.getFields(); for ( Field currentField : fields ) { try { if ( currentField.getType().equals( Rectangle.class ) ) { Rectangle fPageSize = (Rectangle) currentField.get( null ); if ( ( rect.width() == fPageSize.width() ) && ( rect.height() == fPageSize.height() ) ) { return currentField.getName(); } } } catch ( Exception e ) { } } return "A4"; }  static Rectangle getDefaultPageSize(); static String getPageSize( Rectangle rect ); static boolean isPageSizeSupported( String aPageSize ); static void writePdf( InputStream is, OutputStream os ); static void writeRtf( InputStream is, OutputStream os ); static void writeHtml( InputStream is, OutputStream os );  }### Answer:
@Test public void testGetPageSize() throws Exception { assertEquals( "A0", ITextUtil.getPageSize( PageSize.A0 ) ); assertEquals( "A1", ITextUtil.getPageSize( PageSize.A1 ) ); assertEquals( "A2", ITextUtil.getPageSize( PageSize.A2 ) ); assertEquals( "A3", ITextUtil.getPageSize( PageSize.A3 ) ); assertEquals( "A4", ITextUtil.getPageSize( PageSize.A4 ) ); assertEquals( "A5", ITextUtil.getPageSize( PageSize.A5 ) ); assertEquals( "A6", ITextUtil.getPageSize( PageSize.A6 ) ); assertEquals( "A7", ITextUtil.getPageSize( PageSize.A7 ) ); assertEquals( "A8", ITextUtil.getPageSize( PageSize.A8 ) ); assertEquals( "A9", ITextUtil.getPageSize( PageSize.A9 ) ); assertEquals( "A10", ITextUtil.getPageSize( PageSize.A10 ) ); assertEquals( "LETTER", ITextUtil.getPageSize( PageSize.LETTER ) ); assertEquals( "LEGAL", ITextUtil.getPageSize( PageSize.LEGAL ) ); }