code: public String getRandomPassword(int countTotal, int countCapitals, int countSpecials) {
  
          String res = "";
  
          String[] Normals = ArrayUtils.addAll(ArrayUtils.addAll(Capitals, Letters), Numbers);
          Random rand = new Random();
          for (int i = 0; i < (countTotal - countCapitals - countSpecials); i++) {
              res = res + Normals[rand.nextInt(Normals.length)];
          }
          for (int i = 0; i < countSpecials; i++) {
              int pos = rand.nextInt(res.length());
              res = res.substring(0, pos) + Specials[rand.nextInt(Specials.length)] + res.substring(pos);
          }
          for (int i = 0; i < countCapitals; i++) {
              int pos = rand.nextInt(res.length());
              res = res.substring(0, pos) + Capitals[rand.nextInt(Capitals.length)] + res.substring(pos);
          }
          return res;
      }
docs: Generates a random password.<p>
  
  @param countTotal Total password length
  @param countCapitals Minimal count of capitals
  @param countSpecials count of special chars
  @return random password