### Question:
Segment implements Iterable<Map.Entry<Div, Rectangle>>, Iterator<Map.Entry<Div, Rectangle>> { @Override public Iterator<Map.Entry<Div, Rectangle>> iterator() { return this; } Segment(double width); private  Segment(); double getHeight(); boolean tryAdd(Div div); boolean isBlockable(); boolean isEmpty(); boolean isRemainAreaFiller(); List<Div> getContent(); List<Rectangle> getSizeList(); @Override Iterator<Map.Entry<Div, Rectangle>> iterator(); @Override boolean hasNext(); @Override void remove(); double getWidth(); @Override Map.Entry<Div, Rectangle> next();  }### Answer:
@Test void iterator() { Segment sgm = new Segment(900d); sgm.tryAdd(Div.placeholder(100, 300, AFloat.left)); sgm.tryAdd(Div.placeholder(200, 50, AFloat.left)); sgm.tryAdd(Div.placeholder(500, 150, AFloat.left)); sgm.tryAdd(Div.placeholder(500, 600, AFloat.left)); sgm.forEach(kv -> { System.out.println(kv.getKey()); }); System.out.println(); sgm.forEach(kv -> { System.out.println(kv.getKey()); }); }