public static HazelcastInstance getHazelcastClientByName(String instanceName) {
        InstanceFuture<HazelcastClientProxy> future = CLIENTS.get(instanceName);
        if (future == null) {
            return null;
        }

        try {
            return future.get();
        } catch (IllegalStateException t) {
            return null;
        }
    }
@Test
    public void testGetHazelcastClientByName() {
        String instanceName = randomString();
        ClientConfig config = new ClientConfig();
        config.setInstanceName(instanceName);

        HazelcastInstance client1 = HazelcastClient.newHazelcastClient(config);
        assertEquals(client1, HazelcastClient.getHazelcastClientByName(instanceName));
    }