### Question:
ELMoRESTEncoder extends SimpleRESTEncoder { @Override public void encodeEachImpl(Sentence input) throws IOException { encodeEach1D(input.getTokens()); } protected  ELMoRESTEncoder();  ELMoRESTEncoder(RESTAdapter restAdapter);  ELMoRESTEncoder(RESTAdapter restAdapter, String vectorIdentifier); static ELMoRESTEncoder create(ELMoLayerOutput elMoLayerOutput, String domain, int port); static ELMoRESTEncoder create(ELMoLayerOutput elMoLayerOutput, String domain, int port, String vectorIdentifier); static ELMoRESTEncoder create(ELMoLayerOutput elMoLayerOutput, String domain, int port, long embeddingVectorSize, int connectTimeout, int readTimeout); static ELMoRESTEncoder create(ELMoLayerOutput elMoLayerOutput, 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 { elMoRESTEncoder.encodeEachImpl(dummySentence); verify(elMoRESTEncoder, times(1)).encodeEach1D(any()); }
@Test public void encodeEachImplTokenOfDocumentTest() throws IOException { elMoRESTEncoder.encodeEachImpl(dummyDocument); verify(elMoRESTEncoder, times(1)).getTokensOfSentencesOfDocument(eq(dummyDocument)); verify(elMoRESTEncoder, times(1)).encodeEach2D(any()); }
@Test public void encodeEachImplTokenOfDocumentsTest() throws IOException { elMoRESTEncoder.encodeEachImpl(dummyDocuments); verify(elMoRESTEncoder, times(dummyDocuments.size())) .encodeEachImpl(Mockito.any(Document.class)); }