code: public List<GroupedDiagnositcs> getGroupedErrors() {
  		List<GroupedDiagnositcs> grouped = new ArrayList<>();
  		Diagnostic previousError = null;
  		GroupedDiagnositcs group = null;
  
  		for (Diagnostic theError : getErrors()) {
  			boolean isNewField = ((previousError == null) || (previousError.getContext() != theError.
  					getContext())
  					|| (previousError.getComponent() != theError.getComponent()));
  
  			if (group == null || isNewField) {
  				group = new GroupedDiagnositcs();
  				grouped.add(group);
  			}
  
  			group.addDiagnostic(theError);
  
  			previousError = theError;
  		}
  
  		return Collections.unmodifiableList(grouped);
  	}
docs: Groups the errors by their source field.
  
  @return a list of grouped errors.