### Question:
MemoryEnumerable extends AbstractEnumerable<MemoryFactory.Memory<E>> { @Override public Enumerator<MemoryFactory.Memory<E>> enumerator() { return new MemoryEnumerator<>(input.enumerator(), history, future); } MemoryEnumerable(Enumerable<E> input, int history, int future); @Override Enumerator<MemoryFactory.Memory<E>> enumerator();  }### Answer:
@Test void testHistoryAndFuture() { final Enumerable<Integer> input = Linq4j.asEnumerable(IntStream.range(0, 100) .boxed().collect(Collectors.toList())); final MemoryEnumerable<Integer> integers = new MemoryEnumerable<>(input, 5, 1); final Enumerator<MemoryFactory.Memory<Integer>> enumerator = integers.enumerator(); final List<MemoryFactory.Memory<Integer>> results = new ArrayList<>(); while (enumerator.moveNext()) { final MemoryFactory.Memory<Integer> current = enumerator.current(); results.add(current); } assertThat(results.size(), is(100)); assertThat((int) results.get(0).get(), is(0)); assertThat((int) results.get(0).get(1), is(1)); assertThat(results.get(0).get(-2), nullValue()); assertThat((int) results.get(99).get(), is(99)); assertThat((int) results.get(99).get(-2), is(97)); assertThat(results.get(99).get(1), nullValue()); }