@Test public void testImmutable1() throws Exception { RouteList r = new RouteList(Collections.emptyList()); assertThrows(UnsupportedOperationException.class, () -> { r.add(new HandlerRoute(null, VOID_HANDLER)); }); }
@Override public boolean add(Route route) { throw new UnsupportedOperationException("An immutable instance!"); }
RouteList extends ArrayList<Route> implements Route { @Override public boolean add(Route route) { throw new UnsupportedOperationException("An immutable instance!"); } }
RouteList extends ArrayList<Route> implements Route { @Override public boolean add(Route route) { throw new UnsupportedOperationException("An immutable instance!"); } RouteList(PathMatcher pathContext, Collection<Route> records);   RouteList(Collection<Route> records); }
RouteList extends ArrayList<Route> implements Route { @Override public boolean add(Route route) { throw new UnsupportedOperationException("An immutable instance!"); } RouteList(PathMatcher pathContext, Collection<Route> records);   RouteList(Collection<Route> records); @Override Set<Http.RequestMethod> acceptedMethods(); @Override boolean accepts(Http.RequestMethod method); PathMatcher.PrefixResult prefixMatch(CharSequence path); @Override void trimToSize(); @Override Route set(int index, Route route); @Override boolean add(Route route); @Override void add(int index, Route route); @Override Route remove(int index); @Override boolean remove(Object o); @Override void clear(); @Override boolean addAll(Collection c); @Override boolean addAll(int index, Collection c); @Override boolean removeAll(Collection c); @Override boolean retainAll(Collection c); @Override boolean removeIf(Predicate filter); @Override void replaceAll(UnaryOperator operator); @Override void sort(Comparator c); }
RouteList extends ArrayList<Route> implements Route { @Override public boolean add(Route route) { throw new UnsupportedOperationException("An immutable instance!"); } RouteList(PathMatcher pathContext, Collection<Route> records);   RouteList(Collection<Route> records); @Override Set<Http.RequestMethod> acceptedMethods(); @Override boolean accepts(Http.RequestMethod method); PathMatcher.PrefixResult prefixMatch(CharSequence path); @Override void trimToSize(); @Override Route set(int index, Route route); @Override boolean add(Route route); @Override void add(int index, Route route); @Override Route remove(int index); @Override boolean remove(Object o); @Override void clear(); @Override boolean addAll(Collection c); @Override boolean addAll(int index, Collection c); @Override boolean removeAll(Collection c); @Override boolean retainAll(Collection c); @Override boolean removeIf(Predicate filter); @Override void replaceAll(UnaryOperator operator); @Override void sort(Comparator c);  }