I'm not sur I get the logic here. 
In nonEmptyExpected, you already get only the Full(Some(x)) (due to the flatten.flatten), so you are forced to process the same element than in mapBatch, no? 
Well,in mapBatch, it's a map by ruleid, but by construction of mapBatch, it's the same ruleId than in expected... Or you do expect to have the ruleId several time with different ConfigurationExecutionBatch in mapBatch construction, and only keep the last (overriding other) with the .toMap ?