protoBuilder.setTestsCount(task.getNumberOfTests());
Grade gradeProto = protoBuilder.build();
DataOutputStream dataOutput = new DataOutputStream(os);
dataOutput.writeInt(gradeProto.getSerializedSize());
gradeProto.writeTo(dataOutput);
// we will continue work with os, so do not close dataOutput.
}
private Task getTask() throws AgentException {
if (currentJob == null) {