### Question:
IntegrityReport extends Report { public final <T extends Report> T extractReport(final Class<T> reportType) { final Set<Report> reports = this.getReports(); for (Report report : reports) { if (reportType.isInstance(report)) { return reportType.cast(report); } } throw new IllegalArgumentException( String.format("This %s does not contain a %s. Before calling extractReport(), " + "call contains() to make sure the reportType exists." , getClass().getName(), reportType.getName())); } IntegrityReport(); final void addReport(final Report report); final boolean contains(Class<? extends Report> reportType); final Set<Report> getReports(); final void removeReport(final Report report); final T extractReport(final Class<T> reportType); String getDeviceName(); @Override final String getReportType();  }### Answer:
@Test(expectedExceptions = IllegalArgumentException.class) public final void extractNonexistentDeviceInfoReport() { IntegrityReport integrityReport = new IntegrityReport(); integrityReport.extractReport(DeviceInfoReport.class); }