Validation of Capillarity Theory at the Nanometer Scale. II: Stability and Rupture of Water Capillary Bridges in Contact with Hydrophobic and Hydrophilic Surfaces