@VisibleForTesting
  FeedPartition findPartitionToProcess(List<WorkerStatus> workerStatus, List<FeedPartition> feedPartitions){
    for (int i = 0; i < feedPartitions.size(); i++) {
      FeedPartition aPartition = feedPartitions.get(i);
      boolean partitionTaken = false;
      for (int j = 0; j < workerStatus.size(); j++) {
        if (workerStatus.get(j).getFeedPartitionId().equals(aPartition.getPartitionId())) {
          partitionTaken = true;
        }
      }
      if (partitionTaken == false){
        return aPartition;
      }
    }
    return null;
  }
@ VisibleForTesting FeedPartition findPartitionToProcess ( List < WorkerStatus > workerStatus , List < FeedPartition > feedPartitions ) { for ( int i = 0 ; i < feedPartitions . size ( ) ; i ++ ) { FeedPartition aPartition = feedPartitions . get ( i ) ; boolean partitionTaken = false ; for ( int j = 0 ; j < workerStatus . size ( ) ; j ++ ) { if ( workerStatus . get ( j ) . getFeedPartitionId ( ) . equals ( aPartition . getPartitionId ( ) ) ) { partitionTaken = true ; } } if ( partitionTaken == false ) { return aPartition ; } } return null ; }
TODO: in here it "should" be impossible fro a null return
@param workerStatus
@param feedPartitions
@return a partition available for processing or null if none are available