class SqlTypeUtils {

  public static Optional<BeamSqlExpression> findExpressionOfType(
      List<BeamSqlExpression> operands, SqlTypeName type) {

    for (BeamSqlExpression operand : operands) {
      if (type.equals(operand.getOutputType())) {
        return Optional.of(operand);
      }
    }

    return Optional.absent();
  }

}