class ConfigMapLock extends ResourceLock<ConfigMap> {

  private static final Logger LOGGER = LoggerFactory.getLogger(ConfigMapLock.class);

  public ConfigMapLock(String configMapNamespace, String configMapName, String identity) {
    super(configMapNamespace, configMapName, identity);
  }

  public ConfigMapLock(ObjectMeta meta, String identity) {
    super(meta, identity);
  }

  @Override
  protected Class<ConfigMap> getKind() {
    return ConfigMap.class;
  }

  @Override
  protected LeaderElectionRecord toRecord(ConfigMap resource) {<FILL_FUNCTION_BODY>}

  @Override
  protected ConfigMap toResource(LeaderElectionRecord leaderElectionRecord, ObjectMetaBuilder meta) {
    return new ConfigMapBuilder()
        .withMetadata(
            meta.addToAnnotations(LEADER_ELECTION_RECORD_ANNOTATION_KEY, Serialization.asJson(leaderElectionRecord)).build())
        .build();
  }

}

    return Optional.ofNullable(resource.getMetadata().getAnnotations())
        .map(annotations -> annotations.get(LEADER_ELECTION_RECORD_ANNOTATION_KEY))
        .map(annotation -> {
          try {
            return Serialization.unmarshal(annotation, LeaderElectionRecord.class);
          } catch (KubernetesClientException ex) {
            LOGGER.error("Error deserializing LeaderElectionRecord from ConfigMap", ex);
            return null;
          }
        })
        .orElse(null);
  
<methods>public void <init>(java.lang.String, java.lang.String, java.lang.String) ,public void <init>(ObjectMeta, java.lang.String) ,public synchronized void create(io.fabric8.kubernetes.client.KubernetesClient, io.fabric8.kubernetes.client.extended.leaderelection.resourcelock.LeaderElectionRecord) ,public java.lang.String describe() ,public synchronized io.fabric8.kubernetes.client.extended.leaderelection.resourcelock.LeaderElectionRecord get(io.fabric8.kubernetes.client.KubernetesClient) ,public java.lang.String identity() ,public synchronized void update(io.fabric8.kubernetes.client.KubernetesClient, io.fabric8.kubernetes.client.extended.leaderelection.resourcelock.LeaderElectionRecord) <variables>private final non-sealed java.lang.String identity,private final non-sealed ObjectMeta meta,private ConfigMap resource