code: protected static double calculateCriticalValue(boolean is_twoTailed, int n1, int n2, double aLevel) {
          double a=aLevel;
          if(is_twoTailed) {
              a=aLevel/2.0;
          }
          double one_minus_a=1.0-a;
  
          double Ka=1.36;//start by this value and go either up or down until you pass the desired level of significance
  
          int direction=1;//go up
          if(ContinuousDistributions.kolmogorov(Ka)>one_minus_a) {
              direction=-1;//go down
          }
          for(int i=0;i<110;++i) { //Why maximum 110 steps? Because the minimum value before kolmogorov goes to 0 is 0.27 and the maximum (empirically) is about 2.5. Both of them are about 110 steps of 0.01 distance away 
              Ka+=(direction*0.01);
  
              double sign=(one_minus_a-ContinuousDistributions.kolmogorov(Ka))*direction;
              //this changes sign ONLY when we just passed the value
              if(sign<=0) {
                  break;
              }
          }
  
          double criticalValue=Ka*Math.sqrt(((double)n1+n2)/(n1*n2));
  
          return criticalValue;
      }
docs: Calculate Critical Value for a particular $n and $aLevel combination
  
  @param is_twoTailed
  @param n1
  @param n2
  @param aLevel
  @return