### Question:
HCBatchOperations implements BatchOperations<BatchRequest> { @Override public Object createBatchItem(String indexName, Object source) { throw new UnsupportedOperationException("Use ItemSource based API instead"); } HCBatchOperations(PooledItemSourceFactory pooledItemSourceFactory, String mappingType); @Override Object createBatchItem(String indexName, Object source); @Override Object createBatchItem(String indexName, ItemSource source); @Override BatchBuilder<BatchRequest> createBatchBuilder();  }### Answer:
@Test public void throwsOnStringSource() { PooledItemSourceFactory itemSourceFactory = PooledItemSourceFactoryTest.createDefaultTestSourceFactoryConfig().build(); HCBatchOperations batchOperations = new HCBatchOperations(itemSourceFactory, null); String indexName = UUID.randomUUID().toString(); String source = UUID.randomUUID().toString(); expectedException.expect(UnsupportedOperationException.class); expectedException.expectMessage("Use ItemSource based API instead"); batchOperations.createBatchItem(indexName, source); }