We studied wetting phenomena on heterogeneous surfaces by a mean-field free-energy lattice Boltzmann method recently proposed [Phys. Rev. E 69 (2004) 32,602]. Our results suggest that the Cassie equation in macroscopic contact angle measurements is in general not valid. It was found that the Cassie equation is valid only when the patch size is on the same order of the liquid–vapor interfacial thickness. We also demonstrated that contact angle manifests itself from local surface properties near the contact point and does not result from the specific solid–liquid interactions across the contact area.