PdfOtherReport { public void writeSessionInformations(List<SessionInformations> sessionsInformations) throws IOException { try { document.open(); addParagraph(getString("Sessions"), "system-users.png"); new PdfSessionInformationsReport(sessionsInformations, document).toPdf(); } catch (final DocumentException e) { throw createIOException(e); } document.close(); } PdfOtherReport(String application, OutputStream output); void close(); void writeSessionInformations(List<SessionInformations> sessionsInformations); void writeHeapHistogram(HeapHistogram heapHistogram); void writeHotspots(List<SampledMethod> hotspots); void writeProcessInformations(List<ProcessInformations> processInformations); void writeProcessInformations(
			Map<String, List<ProcessInformations>> processInformationsByTitle); void writeDatabaseInformations(DatabaseInformations databaseInformations); void writeJndi(List<JndiBinding> jndiBindings, String path); void writeMBeans(List<MBeanNode> mbeans); void writeMBeans(Map<String, List<MBeanNode>> mbeansByTitle); void writeAllCurrentRequestsAsPart(
			Map<JavaInformations, List<CounterRequestContext>> currentRequests, Collector collector,
			List<Counter> counters, long timeOfSnapshot); void writeRequestAndGraphDetail(Collector collector, CollectorServer collectorServer,
			Range range, String requestId); void writeRuntimeDependencies(Counter counter, Range range); void writeCounterSummaryPerClass(Collector collector, Counter counter, String requestId,
			Range range); void writeThreads(List<JavaInformations> javaInformationsList);  }
@Test public void testWriteSessionInformations() throws IOException { final ByteArrayOutputStream output = new ByteArrayOutputStream(); final List<SessionInformations> sessions = new ArrayList<SessionInformations>(); sessions.add(new SessionInformations(new SessionTestImpl(true), false)); sessions.add(new SessionInformations(new SessionTestImpl(false), false)); final SessionTestImpl serializableButNotSession = new SessionTestImpl(true); serializableButNotSession.setAttribute("serializable but not", Collections.singleton(new Object())); sessions.add(new SessionInformations(serializableButNotSession, false)); PdfOtherReport pdfOtherReport = new PdfOtherReport(TEST_APP, output); pdfOtherReport.writeSessionInformations(Collections.<SessionInformations> emptyList()); assertNotEmptyAndClear(output); pdfOtherReport = new PdfOtherReport(TEST_APP, output); pdfOtherReport.writeSessionInformations(sessions); assertNotEmptyAndClear(output); pdfOtherReport = new PdfOtherReport(TEST_APP, output); pdfOtherReport.writeSessionInformations(Collections .singletonList(new SessionInformations(new SessionTestImpl(false), false))); assertNotEmptyAndClear(output); final SessionTestImpl sessionPays = new SessionTestImpl(true); sessionPays.setCountry("nimporte.quoi"); pdfOtherReport = new PdfOtherReport(TEST_APP, output); pdfOtherReport.writeSessionInformations( Collections.singletonList(new SessionInformations(sessionPays, false))); assertNotEmptyAndClear(output); sessionPays.setCountry(null); assertNull("countryDisplay null", new SessionInformations(sessionPays, false).getCountryDisplay()); pdfOtherReport = new PdfOtherReport(TEST_APP, output); pdfOtherReport.writeSessionInformations( Collections.singletonList(new SessionInformations(sessionPays, false))); assertNotEmptyAndClear(output); }