I'm fetching a set of tuples from the database, and putting it into a map. The database query is costly. 

There is no obvious *natural* ordering of the elements in the map, but *insertion order* matters nonetheless. Sorting the map would be a heavy operation, so I want to avoid doing that, given that the query result is already sorted the way I want it. Therefore, I just store the query result into a `LinkedHashMap`, and return the map from a DAO method:

```
public LinkedHashMap<Key, Value> fetchData()

```

I have a method `processData` that should do some processing on the map - modifying some values, adding some new key/values. It is defined as

```
public void processData(LinkedHashMap<Key, Value> data) {...}

```

However, several linters (Sonar etc) complain that **The type of 'data' should be an interface such as 'Map' rather than the implementation "LinkedHashMap"** ([squid S1319](https://sbforge.org/sonar/rules/show/squid:S1319?layout=false)).  

So basically it is saying that I should have 

```
public void processData(Map<Key, Value> data) {...}

```

But I want the method signature to say that *map order matters* - it matters to the algorithm in `processData` - so that my method is not passed just any random map.

I don't want to use `SortedMap`, because it (from the [javadoc of `java.util.SortedMap`](https://docs.oracle.com/javase/7/docs/api/java/util/SortedMap.html)) "is ordered according to the *natural
ordering* of its keys, or by a *Comparator* typically provided at sorted map creation time."

My keys don't have a *natural ordering*, and creating a *Comparator* to do nothing seems verbose.

And I would still want it to be a map, to take advantage of `put` to avoid duplicate keys etc. If not, `data` could have been a `List<Map.Entry<Key, Value>>`.

So how do I say that my method wants a map that is *already sorted*?
Sadly, there is no `java.util.LinkedMap` interface, or I would have used that.