@VisibleForTesting protected static PlacementTask buildPatch(TaskState.TaskStage patchStage,boolean isDirect,Throwable t){
  PlacementTask state=new PlacementTask();
  state.taskState=new TaskState();
  state.taskState.stage=patchStage;
  state.taskState.isDirect=isDirect;
  if (null != t) {
    state.taskState.failure=Utils.toServiceErrorResponse(t);
  }
  return state;
}

@ VisibleForTesting protected static PlacementTask buildPatch ( TaskState . TaskStage patchStage , boolean isDirect , Throwable t ) { PlacementTask state = new PlacementTask ( ) ; state . taskState = new TaskState ( ) ; state . taskState . stage = patchStage ; state . taskState . isDirect = isDirect ; if ( null != t ) { state . taskState . failure = Utils . toServiceErrorResponse ( t ) ; } return state ; }
builds a new placementtask with the specified stage and isdirect boolean . if throwable t is set then the failure response is added to the task state .
