code: private boolean parentIsNotOfClass(BaseCondition condition, Class<? extends BooleanCondition> expectedParentClass) {
        BaseCondition parent = condition.getParent();
        return parent != null && parent.getClass() != expectedParentClass;
     }
docs: We check if the parent if of the expected class, hoping that if it is then we can avoid wrapping this condition in
  parentheses and still maintain the same logic.
  
  @return {@code true} if wrapping is needed, {@code false} otherwise