private static Map<String,DimensionField> buildNameToDimensionField(@NotNull Set<DimensionField> dimensionFields){
  Map<String,DimensionField> nameToDimensionField=new HashMap<>(dimensionFields.size());
  for (  DimensionField dimensionField : dimensionFields) {
    nameToDimensionField.put(dimensionField.getName(),dimensionField);
  }
  return nameToDimensionField;
}

private static Map < String , DimensionField > buildNameToDimensionField ( @ NotNull Set < DimensionField > dimensionFields ) { Map < String , DimensionField > nameToDimensionField = new HashMap < > ( dimensionFields . size ( ) ) ; for ( DimensionField dimensionField : dimensionFields ) { nameToDimensionField . put ( dimensionField . getName ( ) , dimensionField ) ; } return nameToDimensionField ; }
make a map of dimension field name to dimension field for fast lookups .
