@Test public void lastScrapsTest() { LastScraps<Integer> ls = new LastScraps<>(2); ls.accept(getScrapBin(1,"s1")); ls.accept(getScrapBin(2,"s2")); ls.accept(getScrapBin(3,"s3")); System.out.println(ls.toString()); List<?> last = ls.getLast(); assertEquals(2,last.size()); assertTrue(last.contains("s2")); assertTrue(last.contains("s3")); LastScraps ls2 = LastScraps.of(null,3); assertNotNull(ls2); }
public LastScraps(int size) { results = new ArrayList<>(size); this.last = size-1; for(int i =0;i<size;i++) { results.add(null); } }
LastScraps implements ScrapConsumer<K,Object> { public LastScraps(int size) { results = new ArrayList<>(size); this.last = size-1; for(int i =0;i<size;i++) { results.add(null); } } }
LastScraps implements ScrapConsumer<K,Object> { public LastScraps(int size) { results = new ArrayList<>(size); this.last = size-1; for(int i =0;i<size;i++) { results.add(null); } } LastScraps(int size); }
LastScraps implements ScrapConsumer<K,Object> { public LastScraps(int size) { results = new ArrayList<>(size); this.last = size-1; for(int i =0;i<size;i++) { results.add(null); } } LastScraps(int size); @Override void accept(ScrapBin<K,Object> bin); List<?> getLast(); @Override String toString(); static LastScraps<K> of(Conveyor<K, ?, ?> conv,int size); }
LastScraps implements ScrapConsumer<K,Object> { public LastScraps(int size) { results = new ArrayList<>(size); this.last = size-1; for(int i =0;i<size;i++) { results.add(null); } } LastScraps(int size); @Override void accept(ScrapBin<K,Object> bin); List<?> getLast(); @Override String toString(); static LastScraps<K> of(Conveyor<K, ?, ?> conv,int size);  }