class ParserTask implements Callable<Document>
    {
        private static final ThreadLocal<SAXReader> localSAXReader = ThreadLocal.withInitial(()-> {
            try {
                return constructNewReader();
            } catch (SAXException e) {
                Log.error("Unable to construct a new XML parser.", e);
                return null;
            }
        });

        @Nullable
        private final InputStream stream;

        @Nullable
        private final Reader reader;

        @Nullable
        private final File file;

        public ParserTask(@Nonnull final InputStream stream) {
            this.stream = stream;
            this.reader = null;
            this.file = null;
        }

        public ParserTask(@Nonnull final Reader reader) {
            this.stream = null;
            this.reader = reader;
            this.file = null;
        }

        public ParserTask(@Nonnull final File file) {
            this.stream = null;
            this.reader = null;
            this.file = file;
        }

        @Override
        public Document call() throws Exception {<FILL_FUNCTION_BODY>}
    }

            if (stream != null) {
                return localSAXReader.get().read(stream);
            } else if (reader != null) {
                return localSAXReader.get().read(reader);
            } else if (file != null) {
                return localSAXReader.get().read(file);
            } else {
                // Did you forget to add an 'else' block for the new type that you added?
                throw new IllegalStateException("Unable to parse data. Data is either null, or of an unrecognized type.");
            }
        
<no_super_class>