If you see two methods below :
public static Boolean valueOf(boolean b) {
return (b ? TRUE : FALSE);
}
public static Boolean valueOf(String s) {
return toBoolean(s) ? TRUE : FALSE;
}
These are static methods of Boolean class and return Boolean type object based on parameter that is provided.
So, you don't create Boolean object, instead Boolean class itself creates/returns(already created) object for you. Hence factory for you.