Game game = new Game();
IGame game = new Game();
    public static void main( String[] args ) {        // The Game containing the Board.        Game game = new Game();        IBoard board = game.getBoard();        Coords coords = null;        boolean success = true;        // Try to conduct the test.        try {            // The serialized board *before* it is encoded.            ByteArrayOutputStream before = new ByteArrayOutputStream();            GZIPOutputStream bzos = new GZIPOutputStream(before);            ObjectOutputStream boos = new ObjectOutputStream(bzos);            // The serialized board *after* it is encoded            ByteArrayOutputStream after = new ByteArrayOutputStream();            GZIPOutputStream azos = new GZIPOutputStream(after);            ObjectOutputStream aoos = new ObjectOutputStream(azos);            // The character writer for encoding.            CharArrayWriter to = new CharArrayWriter();            // Load the test board.            board.load( TestBoardEncoder.getTestInputStream() );            // Add some infernos and fires.            ITerrainFactory f = Terrains.getTerrainFactory();                        coords = new Coords( 5, 3 );            board.addInfernoTo( coords, InfernoTracker.STANDARD_ROUND, 1 );            board.getHex( coords ).addTerrain( f.createTerrain(Terrains.FIRE, 1) );            coords = new Coords( 8, 6 );            board.addInfernoTo( coords, InfernoTracker.STANDARD_ROUND, 1 );            board.getHex( coords ).addTerrain( f.createTerrain(Terrains.FIRE, 2) );            coords = new Coords( 4, 10 );            board.getHex( coords ).addTerrain( f.createTerrain(Terrains.FIRE, 2) );            coords = new Coords( 7, 13 );            board.addInfernoTo( coords, InfernoTracker.STANDARD_ROUND, 2 );            board.getHex( coords ).addTerrain( f.createTerrain(Terrains.FIRE, 2) );            coords = new Coords( 11, 14 );            board.getHex( coords ).addTerrain( f.createTerrain(Terrains.FIRE, 2) );            // Save a copy of the board before XML encoding.            boos.writeObject( board );            boos.close();            // Encode the board in XML.            BoardEncoder.encode( board, to );            to.close();            // Decode the board from XML.            ParsedXML root = TinyParser.parseXML                 ( new ByteArrayInputStream(to.toString().getBytes()) );            Enumeration rootChildren = root.elements();            if ( !rootChildren.hasMoreElements() ) {                throw new ParseException( "No children of the root." );            }            ParsedXML rootNode = (ParsedXML)rootChildren.nextElement();            board = BoardEncoder.decode( rootNode, game );            // Save a copy of the board before XML encoding.            aoos.writeObject( board );            aoos.close();            // Walk through the before and after, comparing each in turn.            byte[] beforeBuf = before.toByteArray();            byte[] afterBuf  = after.toByteArray();            if ( beforeBuf.length != afterBuf.length ) {                System.out.print( "Different lengths!!!  Before: " );                System.out.print( beforeBuf.length );                System.out.print( ", After: " );                System.out.print( afterBuf.length );                System.out.println( "." );                success = false;            } else {                System.out.print( "Comparing " );                System.out.print( beforeBuf.length );                System.out.println( " bytes." );                for ( int index = 0;                      success && index < beforeBuf.length;                      index++ ) {                    if ( beforeBuf[index] != afterBuf[index] ) {                        System.out.print( "Different bytes at index " );                        System.out.print( index );                        System.out.print( "!!!  Before: " );                        System.out.print( beforeBuf[index] );                        System.out.print( ", After: " );                        System.out.print( afterBuf[index] );                        System.out.println( "." );                        success = false;                    }                }            }        } catch ( Throwable err ) {            err.printStackTrace();            success = false;        }        if ( success ) {            System.out.println( "Success!!!" );        }    }