}
final byte[] serialized = array.toByteArray();
final ByteArrayInputStream sarray = new ByteArrayInputStream(serialized);
final InputSerializer in = new InputSerializer(sarray);
final int amount = in.readInt();
assertEquals(amount, tilesets.size());
final List<TileSetDefinition> serializedTilesets = new LinkedList<TileSetDefinition>();
for (int i = 0; i < amount; i++) {
serializedTilesets.add((TileSetDefinition) in.readObject(new TileSetDefinition(
null, 0)));
}
assertEquals(tilesets, serializedTilesets);
}