title: Is there any way to know that the CellStyle is already present in Workbook(to reuse) using POI or to Copy only Celstyle obj not reference
body: <p>I want to write some records into excel but I got to know that the maximum cell styles in <strong><code>XSSFWorkbook</code> is 64000</strong>.But records exceeding more than 64000 and consider I want to apply new <code>cellstyle</code> to each cell or <strong>I will clone with the already existing cell style.</strong> </p>
  
  <p>Even to clone I need to take default cell style  <a href="http://poi.apache.org/apidocs/org/apache/poi/hssf/usermodel/HSSFWorkbook.html#createCellStyle()" rel="noreferrer"><strong><code>workbook.createCellStyle();</code></strong></a> but this exceeds for 64001 record which leads to <code>java.lang.IllegalStateException: The maximum number of cell styles was exceeded.</code>.</p>
  
  <blockquote>
    <p>So is there anyway in POI to know already particular cell style is
    present and make use of that or when is necessary to clone/create
    default cellstyle and clone.</p>
  </blockquote>
  
  <p>Reason for cloning is : Sometimes column/row <code>cellstyle</code> and  <em>existing refered excel cellstyle</em>  may be different, so am taking default cell style and cloning col &amp; row &amp; cell <code>cellstyles</code> to it.</p>
  
  <p>Even I tried to add  a default style to a map<code>map.put("defStyle",workbook.createCellStyle();)</code> but this wont clone properly, because it will change at first attempt of cloning since <strong><code>It wont get the Object it will copy the reference</code></strong> even object cloning also not possible here because cellstyle doesn't implement <code>cloneable interface</code>.</p>