BatchChangeSetPart changeRequest = BatchChangeSetPart.method(POST)
.uri("Employees")
.body(body)
.headers(changeSetHeaders)
.build();
BatchChangeSet changeSet = BatchChangeSet.newBuilder().build();
changeSet.add(changeRequest);
batch.add(changeSet);
Map<String, String> changeSetHeaders2 = new HashMap<String, String>();
changeSetHeaders2.put("content-type", "application/json;odata=verbose");
changeSetHeaders2.put("content-Id", "222");
BatchChangeSetPart changeRequest2 = BatchChangeSetPart.method(PUT)
.uri("Employees('2')/ManagerId")
.body("{\"ManagerId\":1}")
.headers(changeSetHeaders2)
.build();
BatchChangeSet changeSet2 = BatchChangeSet.newBuilder().build();
changeSet2.add(changeRequest2);
batch.add(changeSet2);
BatchRequestWriter writer = new BatchRequestWriter();
InputStream batchRequest = writer.writeBatchRequest(batch, BOUNDARY);
assertNotNull(batchRequest);