code: public static void setPosTags(Token token, JCas jcas, String... posTags) {
  
          FSArray slots = new FSArray(jcas, posTags.length);
          for (int i = 0; i < posTags.length; i++) {
              POSTag posTag = new POSTag(jcas);
              posTag.setValue(posTags[i]);
              posTag.addToIndexes();
              slots.set(i, posTag);
          }
          token.setPosTag(slots);
      }
docs: Convenience method to set POS tag