code: public static double getPvalue(FlatDataCollection flatDataCollection, double median) {
          int n=0;
          AssociativeArray Di = new AssociativeArray();
          Iterator<Double> it = flatDataCollection.iteratorDouble();
          while(it.hasNext()) {
              double delta=it.next()-median;
  
              if(delta==0.0) {
                  continue; //don't count it at all
              }
  
              String key="+";
              if(delta<0) {
                  key="-";
              }
              Di.put(key+String.valueOf(n), Math.abs(delta));
              ++n;
          }
          if(n<=0) {
              throw new IllegalArgumentException("The provided collection can't be empty.");
          }
  
          //converts the values of the table with its Ranks
          Ranks.getRanksFromValues(Di);
          double W=0.0;
          for(Map.Entry<Object, Object> entry : Di.entrySet()) {
              String key = entry.getKey().toString();
              Double rank = TypeInference.toDouble(entry.getValue());
          
              if(key.charAt(0)=='+') {
                  W+=rank;
              }
          }
  
          double pvalue= scoreToPvalue(W, n);
  
          return pvalue;
      }
docs: Calculates the p-value of null Hypothesis
  
  @param flatDataCollection
  @param median
  @return