Aspose cells java - styles

How do I get all the custom styles defined in the workbook? I need something similar to stylesCollection that has now been deprecated.
I want to iterate over all custom defined styles and rename them to something else.

Another somewhat related question : If 2 woekbooks contain same named styles but actual styles are different. when they are merged together using combine() method of workbook, what happens to these styles? do they get overwritten?

@redred,

Please try using getCountOfStylesInPool() and getStyleInPool() methods of Workbook for your requirements. See the following sample code for your reference.
e.g.
Sample code:

      Workbook workbook = new Workbook(stringFilePath);
      int styleCount = workbook.getCountOfStylesInPool();
        for (int i = 0; i < styleCount; i++)
        {
            Style style = workbook.getStyleInPool(i);
           //.......
           //your code goes here.
          //........ 
        }
 ......

When merging the workbooks, the styles would be overwritten, we will provide more details on it. You may also experiment or test it using your files and update us if you find some issue.

@redred,

Please note, when merging workbooks (having same named styles), Aspose.Cells copies the style settings of other workbook except the name of the style.