(
NavigableSet<E> set)
| 1163 | } |
| 1164 | |
| 1165 | @GwtIncompatible // NavigableSet |
| 1166 | private static <E extends @Nullable Object> NavigableSet<E> removeOnlyNavigableSet( |
| 1167 | NavigableSet<E> set) { |
| 1168 | return new ForwardingNavigableSet<E>() { |
| 1169 | @Override |
| 1170 | protected NavigableSet<E> delegate() { |
| 1171 | return set; |
| 1172 | } |
| 1173 | |
| 1174 | @Override |
| 1175 | public boolean add(@ParametricNullness E element) { |
| 1176 | throw new UnsupportedOperationException(); |
| 1177 | } |
| 1178 | |
| 1179 | @Override |
| 1180 | public boolean addAll(Collection<? extends E> es) { |
| 1181 | throw new UnsupportedOperationException(); |
| 1182 | } |
| 1183 | |
| 1184 | @Override |
| 1185 | public SortedSet<E> headSet(@ParametricNullness E toElement) { |
| 1186 | return removeOnlySortedSet(super.headSet(toElement)); |
| 1187 | } |
| 1188 | |
| 1189 | @Override |
| 1190 | public NavigableSet<E> headSet(@ParametricNullness E toElement, boolean inclusive) { |
| 1191 | return removeOnlyNavigableSet(super.headSet(toElement, inclusive)); |
| 1192 | } |
| 1193 | |
| 1194 | @Override |
| 1195 | public SortedSet<E> subSet( |
| 1196 | @ParametricNullness E fromElement, @ParametricNullness E toElement) { |
| 1197 | return removeOnlySortedSet(super.subSet(fromElement, toElement)); |
| 1198 | } |
| 1199 | |
| 1200 | @Override |
| 1201 | public NavigableSet<E> subSet( |
| 1202 | @ParametricNullness E fromElement, |
| 1203 | boolean fromInclusive, |
| 1204 | @ParametricNullness E toElement, |
| 1205 | boolean toInclusive) { |
| 1206 | return removeOnlyNavigableSet( |
| 1207 | super.subSet(fromElement, fromInclusive, toElement, toInclusive)); |
| 1208 | } |
| 1209 | |
| 1210 | @Override |
| 1211 | public SortedSet<E> tailSet(@ParametricNullness E fromElement) { |
| 1212 | return removeOnlySortedSet(super.tailSet(fromElement)); |
| 1213 | } |
| 1214 | |
| 1215 | @Override |
| 1216 | public NavigableSet<E> tailSet(@ParametricNullness E fromElement, boolean inclusive) { |
| 1217 | return removeOnlyNavigableSet(super.tailSet(fromElement, inclusive)); |
| 1218 | } |
| 1219 | |
| 1220 | @Override |
| 1221 | public NavigableSet<E> descendingSet() { |
| 1222 | return removeOnlyNavigableSet(super.descendingSet()); |
no outgoing calls
no test coverage detected