public static String buildFilterClause(final String sql,final Object value,final List<Object> preparedArgs){
  if (value != null) {
    preparedArgs.add(value);
    return sql;
  }
 else {
    return null;
  }
}

public static String buildFilterClause ( final String sql , final Object value , final List < Object > preparedArgs ) { if ( value != null ) { preparedArgs . add ( value ) ; return sql ; } else { return null ; } }
returns the sql filter clause when value to set as prepared argument isn ' t null otherwise null is returned .
