### Question:
FastTextRESTEncoder extends SimpleRESTEncoder { @Override public void encodeEachImpl(Sentence input) throws IOException { encodeEach1D(input.getTokens()); } protected  FastTextRESTEncoder();  FastTextRESTEncoder(RESTAdapter restAdapter);  FastTextRESTEncoder(RESTAdapter restAdapter, String vectorIdentifier); static FastTextRESTEncoder create(String domain, int port); static FastTextRESTEncoder create(String domain, int port, String vectorIdentifier); static FastTextRESTEncoder create(String domain, int port, long embeddingVectorSize, int connectTimeout, int readTimeout); static FastTextRESTEncoder create(String domain, int port, long embeddingVectorSize, int connectTimeout, int readTimeout, String vectorIdentifier); @Override INDArray encodeImpl(String word); @Override INDArray encodeImpl(Span span); @Override void encodeEachImpl(Sentence input); @Override void encodeEachImpl(Document input); @Override void encodeEachImpl(Collection<Document> docs);  }### Answer:
@Test public void encodeEachImplTokenOfSentenceTest() throws IOException { fastTextRestEncoder.encodeEachImpl(dummySentence); verify(fastTextRestEncoder, times(1)).encodeEach1D(any()); }
@Test public void encodeEachImplTokenOfDocumentTest() throws IOException { fastTextRestEncoder.encodeEachImpl(dummyDocument); verify(fastTextRestEncoder, times(1)).encodeEach2D(any()); verify(fastTextRestEncoder, times(1)).getTokensOfSentencesOfDocument(eq(dummyDocument)); }
@Test public void encodeEachImplTokenOfDocumentsTest() throws IOException { fastTextRestEncoder.encodeEachImpl(dummyDocuments); verify(fastTextRestEncoder, times(dummyDocuments.size())) .encodeEachImpl(Mockito.any(Document.class)); }