class PowerPointMetadataReader {

    public static PowerpointMetadata instance( InputStream stream ) throws IOException {
        POIFSFileSystem fs = new POIFSFileSystem(stream);
        HSLFSlideShow rawSlideShow = new HSLFSlideShow(fs);
        List<SlideMetadata> slidesMetadata = rawSlideShow.getSlides()
                                                         .stream()
                                                         .map(slide -> processSlide(rawSlideShow, slide))
                                                         .collect(Collectors.toList());

        PowerpointMetadata deck = new PowerpointMetadata();
        deck.setSlides(slidesMetadata);
        deck.setMetadata(new HSLFSlideShowImpl(fs).getSummaryInformation());
        return deck;
    }

}