code: public static int ttIndex(Boolean bVal)
    {
    	int idx = 2;
    	
    	if(bVal != null)
    	{
        if (bVal.booleanValue())
    	  {
    	    idx = 0;
  }
    	  else if (!bVal.booleanValue())
    	  {
          idx = 1;
    	  }
    	}
    	return idx;
    }
docs: Get Truth Table index