If statements evaluate boolean expressions, which can be stored as a boolean value and passed on to the if statement through a variable.
An example method:
public doSTuff(List<object>data, boolean condition){
if(condition){
//do stuff to data
}
}
//somewhere else
List<sobject> = [SOQL..]; //dummy code
boolean condition = param1 > data.size(); //dummy boolean expression
doStuff(data,condition); //passing your boolean expression to the method
//somewhere else 2
List<sobject> = [SOQL..]; //dummy code
boolean condition = param1 <= data.size(); //different boolean expression
doStuff(data,condition); //same method!