### Question:
DocumentImpl implements Document { @Override public Entry toEntry(Step next) { return new DocumentEntry(this, next); } DocumentImpl(byte[] rawData, String id, Plan plan, Operation operation, Scanner source); @Override Multiset<String> keys(); @Override boolean putAll(@Nullable java.lang.String key, Iterable<? extends String> values); @Override boolean put(@Nonnull java.lang.String key, @Nonnull java.lang.String value); @Override boolean putAll(Multimap<? extends String, ? extends String> multimap); @Override Set<String> keySet(); @Override boolean containsEntry(@Nullable java.lang.Object key, @Nullable java.lang.Object value); @Override boolean remove(@Nullable java.lang.Object key, @Nullable java.lang.Object value); @Override boolean containsValue(@Nullable java.lang.Object value); @Override Collection<Map.Entry<String, String>> entries(); @Override boolean isEmpty(); @Override void clear(); @Override Map<String, Collection<String>> asMap(); @Override List<String> replaceValues(@Nullable java.lang.String key, Iterable<? extends String> values); @Override Collection<String> values(); @Override boolean containsKey(@Nullable java.lang.Object key); @Override List<String> get(@Nullable java.lang.String key); @Override int size(); @Override List<String> removeAll(@Nullable java.lang.Object key); @Override byte[] getRawData(); @Override void setRawData(byte[] rawData); @Override Status getStatus(); @Override void setStatus(Status status, String statusMessage); @Override void setStatus(Status status); @Override String getStatusMessage(); @Override void setStatusMessage(String message); @Override Entry toEntry(Step next); @Override ArrayListMultimap<String, String> getDelegate(); @Override String getId(); @Override String getHash(); @Override String getIdField(); @Override Operation getOperation(); String getSourceScannerName(); @Override String getFirstValue(String fieldName); @Override String toString();  }### Answer:
@Test public void testToEntry() { ArrayListMultimap<String, String> stupidFinalClass = ArrayListMultimap.create(); expect(obj.getDelegate()).andReturn(stupidFinalClass); expect(obj.getSourceScannerName()).andReturn("foo"); expect(obj.getStatus()).andReturn(PROCESSING); expect(obj.getStatusMessage()).andReturn("ok"); byte[] value = {}; expect(obj.getRawData()).andReturn(value); expect(stepMock.getName()).andReturn("bar"); expect(obj.getOperation()).andReturn(Document.Operation.UPDATE); replay(); DocumentImpl.DocumentEntry e = (DocumentImpl.DocumentEntry) obj.toEntry(stepMock); assertEquals(stupidFinalClass, e.contents); assertEquals("foo", e.scannerName); assertEquals(PROCESSING, e.status); assertEquals("ok", e.statusMessage); assertEquals(value, e.data.data); assertEquals("bar", e.nextStepName); assertEquals(Document.Operation.UPDATE.toString(), e.operation); }