Map<String, Long> args = new HashMap<>();
args.put("A", 10L);
args.put("Count", 20L);
args.put("ErrorAt", -1L);
args.put("BadTypeAt", 4L);
BSONObject mArgs = new BasicBSONObject();
mArgs.putAll(args);
client.streamCall("Arith.Thrive", mArgs);
Response response;
long index = 0;
while (index < args.get("BadTypeAt") && (response = client.streamNext()) != null) {
BSONObject result = (BSONObject) response.getReply();
Assert.assertEquals(args.get("A"), result.get("C"));
Assert.assertEquals(index, result.get("Index"));
index++;
}
Assert.assertEquals(args.get("BadTypeAt").longValue(), index);
try {