code: public AndCondition optimize() {
          AndCondition result = new AndCondition();
          for (Condition each : conditions) {
              if (Condition.class.equals(each.getClass())) {
                  result.getConditions().add(each);
              }
          }
          if (result.getConditions().isEmpty()) {
              result.getConditions().add(new NullCondition());
          }
          return result;
      }
docs: Optimize and condition.
  
  @return and condition