@Override
    public Boolean exists(final String key) {
        try {
            List<InstanceInfo> instances = eurekaClient.getInstancesByVipAddressAndAppName(null, key, true);
            return !instances.isEmpty();
        } catch (Exception e) {
            throw new ShenyuException(e);
        }
    }
@Test
    void testExists() {
        final String key = "testService";
        final List<InstanceInfo> instances = new ArrayList<>();
        instances.add(mock(InstanceInfo.class));

        // Mock this service exists
        when(eurekaClient.getInstancesByVipAddressAndAppName(null, key, true)).thenReturn(instances);
        assertTrue(eurekaDiscoveryServiceUnderTest.exists(key));

        // Mock the service does not exist
        when(eurekaClient.getInstancesByVipAddressAndAppName(null, key, true)).thenReturn(Collections.emptyList());
        assertFalse(eurekaDiscoveryServiceUnderTest.exists(key));
        
        // Mock the throwing of Exception
        when(eurekaClient.getInstancesByVipAddressAndAppName(null, key, true)).thenThrow(new ShenyuException("test"));
        assertThrows(ShenyuException.class, () -> eurekaDiscoveryServiceUnderTest.exists(key));
    }