UnavailableException extends ServletException { @Deprecated public Servlet getServlet() { throw new UnsupportedOperationException(); } UnavailableException(String message);  UnavailableException(String message, int unavailableSeconds); @Deprecated  UnavailableException(Servlet servlet, String message); @Deprecated  UnavailableException(int unavailableSeconds, Servlet servlet, String message); @Deprecated Servlet getServlet(); int getUnavailableSeconds(); boolean isPermanent();  }
@Test void testGetServlet() { UnavailableException exception = new UnavailableException("Unavailable"); assertThrows(UnsupportedOperationException.class, exception::getServlet); }