CacheConfig<K, V> asCacheConfig() {
        return this.copy(new CacheConfig<>(), false);
    }
@Test
    public void serializationSucceeds_whenKeyTypeNotResolvable() {
        PreJoinCacheConfig preJoinCacheConfig = new PreJoinCacheConfig(newDefaultCacheConfig("test"));
        preJoinCacheConfig.setKeyClassName("some.inexistent.Class");
        preJoinCacheConfig.setValueClassName("java.lang.String");
        Data data = serializationService.toData(preJoinCacheConfig);
        PreJoinCacheConfig deserialized = serializationService.toObject(data);
        assertEquals(deserialized, preJoinCacheConfig);
        try {
            Class klass = deserialized.asCacheConfig().getKeyType();
            fail("Getting the key type on deserialized CacheConfig should fail because the key type cannot be resolved");
        } catch (HazelcastException e) {
            if (!(e.getCause() instanceof ClassNotFoundException)) {
                fail("Unexpected exception: " + e.getCause());
            }
        }
    }