### Question:
SimpleRESTEncoder extends AbstractRESTEncoder { @Override public void encodeEach(Sentence input, Class<? extends Span> elementClass) { if(elementClass == this.elementClass){ try { encodeEachImpl(input); }catch (IOException e){ log.error("IO Error while encoding sentence: {}", input, e); throw new UncheckedIOException(e); } } else { throw new UnsupportedOperationException(); } } protected  SimpleRESTEncoder(String id);  SimpleRESTEncoder(String id, RESTAdapter restAdapter, Class<? extends Span> elementClass);  SimpleRESTEncoder(String id, RESTAdapter restAdapter, String vectorIdentifier, Class<? extends Span> elementClass); @Override INDArray encode(String word); abstract INDArray encodeImpl(String word); @Override INDArray encode(Span span); abstract INDArray encodeImpl(Span span); @Override void encodeEach(Sentence input, Class<? extends Span> elementClass); abstract void encodeEachImpl(Sentence input); @Override void encodeEach(Document input, Class<? extends Span> elementClass); abstract void encodeEachImpl(Document input); @Override void encodeEach(Collection<Document> docs, Class<? extends Span> elementClass); abstract void encodeEachImpl(Collection<Document> docs); INDArray encodeValue(String value); List<List<Token>> getTokensOfSentencesOfDocument(Document document); Stream<Stream<Token>> streamTokensOfSentencesOfDocument(Document document); Stream<Stream<S>> streamSpans2D(List<? extends List<S>> spans2D); void encodeEach(S span); void encodeEach(S span, Function<S, String> getText); void encodeEach1D(List<S> spans); void encodeEach1D(List<S> spans, Function<S, String> getText); void encodeEach2D(List<? extends List<S>> spans); void encodeEach2D(List<? extends List<S>> spans, Function<S, String> getText); String[] spansToStringArray1D(Stream<S> spans); String[] spansToStringArray1D(Stream<S> spans, Function<S, String> getText); String[][] spansToStringArray2D(Stream<? extends Stream<S>> spans); String[][] spansToStringArray2D(Stream<? extends Stream<S>> spans, Function<S, String> getText); void putVectorInSpan(S span, double[] data); void putVectorInSpans(Stream<S> spans, double[][] data); void putVectorInSpans(Stream<? extends Stream<S>> spans, double[][][] data);  }### Answer:
@Test(expected = UnsupportedOperationException.class) public void encodeEachSentenceSentenceTest(){ simpleRESTEncoder.encodeEach(dummySentence, Sentence.class); }
@Test(expected = UnsupportedOperationException.class) public void encodeEachDocumentSentenceTest(){ simpleRESTEncoder.encodeEach(dummyDocument, Sentence.class); }
@Test(expected = UnsupportedOperationException.class) public void encodeEachDocumentsSentenceTest(){ simpleRESTEncoder.encodeEach(Lists.newArrayList(dummyDocument), Sentence.class); }
@Test public void encodeEachTest() throws IOException { simpleRESTEncoder.encodeEach(dummySpan); verify(restAdapter, times(1)).encode(eq(DummySpan.TEXT)); verifySpanVector(dummySpan); }