public static String localIP() {
        if (!StringUtils.isEmpty(localIp)) {
            return localIp;
        }
        if (System.getProperties().containsKey(CLIENT_LOCAL_IP_PROPERTY)) {
            return localIp = System.getProperty(CLIENT_LOCAL_IP_PROPERTY, getAddress());
        }
        localIp = getAddress();
        return localIp;
    }
@Test
    void testLocalIpWithException() throws Exception {
        Field field = System.class.getDeclaredField("props");
        field.setAccessible(true);
        Properties properties = (Properties) field.get(null);
        Properties mockProperties = mock(Properties.class);
        when(mockProperties.getProperty("java.net.preferIPv6Addresses")).thenThrow(new RuntimeException("test"));
        field.set(null, mockProperties);
        try {
            System.setProperty("java.net.preferIPv6Addresses", "aaa");
            InetAddress expect = InetAddress.getLocalHost();
            assertEquals(expect.getHostAddress(), NetUtils.localIP());
        } finally {
            field.set(null, properties);
        }
    }