### Question:
SimpleRESTEncoder extends AbstractRESTEncoder { public List<List<Token>> getTokensOfSentencesOfDocument(Document document) { return document.streamSentences() .map(Sentence::getTokens) .collect(Collectors.toList()); } 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 public void getTokensOfSentencesOfDocumentTest(){ List<List<Token>> tokens2D = simpleRESTEncoder.getTokensOfSentencesOfDocument(dummyDocument); assertThat(tokens2D.size(), equalTo(dummyDocument.countSentences())); for (int i = 0; i < tokens2D.size(); i++) { List<Token> tokens1D = tokens2D.get(i); Sentence sentence = dummyDocument.getSentence(i); assertThat(tokens1D.size(), equalTo(sentence.countTokens())); for (int n = 0; n < tokens1D.size(); n++){ assertThat(tokens1D.get(n), equalTo(sentence.getToken(n))); } } }