Source:
protected void writeSecurities(final BootstrapSession session, final BootstrapConfig cfg, final List<Integer> securityInstancesToWrite) { if (!securityInstancesToWrite.isEmpty()) { Integer key = securityInstancesToWrite.get(0); ServerSecurity securityConfig = cfg.security.get(key); LwM2mPath path = new LwM2mPath(0, key); final LwM2mNode securityInstance = BootstrapUtil.convertToSecurityInstance(key, securityConfig); final BootstrapWriteRequest writeBootstrapRequest = new BootstrapWriteRequest(path, securityInstance, session.getContentFormat()); send(session, writeBootstrapRequest, new ResponseCallback<BootstrapWriteResponse>() { @Override public void onResponse(BootstrapWriteResponse response) { if (response.isSuccess()) { LOG.trace("{} receives for {}", session, response, writeBootstrapRequest); sessionManager.onSuccess(writeBootstrapRequest); afterWriteSecurities(session, cfg, securityInstancesToWrite, BootstrapAction.CONTINUE); } else { LOG.debug("{} receives for {}", session, response, writeBootstrapRequest); BootstrapAction action = sessionManager.onError(writeBootstrapRequest, response); afterWriteSecurities(session, cfg, securityInstancesToWrite, action); } } }, new ErrorCallback() { @Override public void onError(Exception e) { LOG.debug("Error for while sending ", session, writeBootstrapRequest, e); BootstrapAction action = sessionManager.onFailure(writeBootstrapRequest, e); afterWriteSecurities(session, cfg, securityInstancesToWrite, action); } }); } else { List<Integer> serverInstancesToWrite = new ArrayList<>(cfg.servers.keySet()); writeServers(session, cfg, serverInstancesToWrite); } }

Target:
protected void writeSecurities(final BootstrapSession session, final BootstrapConfig cfg, final List<Integer> securityInstancesToWrite) { if (!securityInstancesToWrite.isEmpty()) { Integer key = securityInstancesToWrite.get(0); ServerSecurity securityConfig = cfg.security.get(key); LwM2mPath path = new LwM2mPath(0, key); final LwM2mNode securityInstance = BootstrapUtil.convertToSecurityInstance(key, securityConfig); final BootstrapWriteRequest writeBootstrapRequest = new BootstrapWriteRequest(path, securityInstance, session.getContentFormat()); send(session, writeBootstrapRequest, new SafeResponseCallback<BootstrapWriteResponse>(session) { @Override public void safeOnResponse(BootstrapWriteResponse response) { if (response.isSuccess()) { LOG.trace("{} receives for {}", session, response, writeBootstrapRequest); sessionManager.onResponseSuccess(session, writeBootstrapRequest); afterWriteSecurities(session, cfg, securityInstancesToWrite, BootstrapPolicy.CONTINUE); } else { LOG.debug("{} receives for {}", session, response, writeBootstrapRequest); BootstrapPolicy policy = sessionManager.onResponseError(session, writeBootstrapRequest, response); afterWriteSecurities(session, cfg, securityInstancesToWrite, policy); } } }, new SafeErrorCallback(session) { @Override public void safeOnError(Exception e) { LOG.debug("Error for while sending ", session, writeBootstrapRequest, e); BootstrapPolicy policy = sessionManager.onRequestFailure(session, writeBootstrapRequest, e); afterWriteSecurities(session, cfg, securityInstancesToWrite, policy); } }); } else { List<Integer> serverInstancesToWrite = new ArrayList<>(cfg.servers.keySet()); writeServers(session, cfg, serverInstancesToWrite); } }