When inspecting Map and SortedMap interfaces, I have noticed many methods that are already defined within Map interface are also redefined (not simply let inherited) within the SortedMap.
SortedMap extending Map, why redeclaring some methods like for instance:
Set<K> keySet();
Collection<V> values();
Why this redundancy?
(I use JDK 7)
I would say that methods are declared in interfaces and methods are defined in classes.
Map are not guaranteed to be ordered but Sorted Maps are. This means what each method will guarantee is different and needs different documentation.
The Javadoc for Map.keySet() is highlighting the differences
The Javadoc for SortedMap.keySet() is