operator/src/main/java/oracle/kubernetes/utils/OperatorUtils.java
public static <T> Map<String, T> createSortedMap(Map<String, T> map) {
    if (map == null) {
      return Collections.emptyMap();
    }
    return map.entrySet()
        .stream()
        .sorted(Comparator
            .comparing((Entry<String, T> entry) -> getSortingString(entry.getKey())))
        .collect(Collectors.toMap(
            Map.Entry::getKey,
            Map.Entry::getValue,
            (oldValue, newValue) -> oldValue, LinkedHashMap::new));
  }
/**
   * Create a Map using the elements from the given map, with their keys sorted
   * using the sorted name as returned by {@link #getSortingString(String)}.
   *
   * @param map Map containing elements to be sorted by the keys
   * @param <T> Type of map entries
   * @return A sorted Map containing the elements from the give map
   */
Create a Map using the elements from the given map, with their keys sorted
using the sorted name as returned by  #getSortingString(String).

@param map Map containing elements to be sorted by the keys
@param  Type of map entries
@return A sorted Map containing the elements from the give map
Create a Map using the elements from the given map with their keys sorted using the sorted name as returned by #getSortingString ( String ) . @param map Map containing elements to be sorted by the keys @param Type of map entries @return A sorted Map containing the elements from the give map
public static <T> Map<String, T> createSortedMap(Map<String, T> map) {
    if (map == null) {
      return Collections.emptyMap();
    }
    return map.entrySet()
        .stream()
        .sorted(Comparator
            .comparing((Entry<String, T> entry) -> getSortingString(entry.getKey())))
        .collect(Collectors.toMap(
            Map.Entry::getKey,
            Map.Entry::getValue,
            (oldValue, newValue) -> oldValue, LinkedHashMap::new));
  }
public static < T > Map < String , T > createSortedMap ( Map < String , T > map ) { if ( map == null ) { return Collections . emptyMap ( ) ; } return map . entrySet ( ) . stream ( ) . sorted ( Comparator . comparing ( ( Entry < String , T > entry ) -> getSortingString ( entry . getKey ( ) ) ) ) . collect ( Collectors . toMap ( Map . Entry :: getKey , Map . Entry :: getValue , ( oldValue , newValue ) -> oldValue , LinkedHashMap :: new ) ) ; }
Create a Map using the elements from the given map, with their keys sorted
 using the sorted name as returned by {@link #getSortingString(String)}.
Create a Map using the elements from the given map with their keys sorted using the sorted name as returned by { @link #getSortingString ( String ) } .