Skip to content

Commit 07e4cca

Browse files
committed
Remove cast
1 parent b8d0a7f commit 07e4cca

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/test/java/org/apache/commons/collections4/map/AbstractSortedMapTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ public String getCompatibilityVersion() {
6262

6363
@Override
6464
public SortedMap<K, V> makeFullMap() {
65-
return ((SortedMap<K, V>) main.makeFullMap()).headMap(toKey);
65+
return main.makeFullMap().headMap(toKey);
6666
}
6767

6868
@Override
6969
public SortedMap<K, V> makeObject() {
7070
// done this way so toKey is correctly set in the returned map
71-
return ((SortedMap<K, V>) main.makeObject()).headMap(toKey);
71+
return main.makeObject().headMap(toKey);
7272
}
7373

7474
@Test
@@ -125,13 +125,13 @@ public String getCompatibilityVersion() {
125125

126126
@Override
127127
public SortedMap<K, V> makeFullMap() {
128-
return ((SortedMap<K, V>) main.makeFullMap()).subMap(fromKey, toKey);
128+
return main.makeFullMap().subMap(fromKey, toKey);
129129
}
130130

131131
@Override
132132
public SortedMap<K, V> makeObject() {
133133
// done this way so toKey is correctly set in the returned map
134-
return ((SortedMap<K, V>) main.makeObject()).subMap(fromKey, toKey);
134+
return main.makeObject().subMap(fromKey, toKey);
135135
}
136136

137137
@Test
@@ -182,13 +182,13 @@ public String getCompatibilityVersion() {
182182

183183
@Override
184184
public SortedMap<K, V> makeFullMap() {
185-
return ((SortedMap<K, V>) main.makeFullMap()).tailMap(fromKey);
185+
return main.makeFullMap().tailMap(fromKey);
186186
}
187187

188188
@Override
189189
public SortedMap<K, V> makeObject() {
190190
// done this way so toKey is correctly set in the returned map
191-
return ((SortedMap<K, V>) main.makeObject()).tailMap(fromKey);
191+
return main.makeObject().tailMap(fromKey);
192192
}
193193

194194
@Test
@@ -359,7 +359,7 @@ public SortedMap<K, V> getConfirmed() {
359359
*/
360360
@Override
361361
public SortedMap<K, V> getMap() {
362-
return (SortedMap<K, V>) super.getMap();
362+
return super.getMap();
363363
}
364364

365365
/**
@@ -387,7 +387,7 @@ public SortedMap<K, V> makeConfirmedMap() {
387387
*/
388388
@Override
389389
public SortedMap<K, V> makeFullMap() {
390-
return (SortedMap<K, V>) super.makeFullMap();
390+
return super.makeFullMap();
391391
}
392392

393393
/**

0 commit comments

Comments
 (0)