### Question:
BorderArrangement implements Arrangement, Serializable { @Override public void add(Block block, Object key) { if (key == null) { this.centerBlock = block; } else if (!(key instanceof RectangleEdge)) { throw new IllegalArgumentException("The 'key' must be an instance " + "of RectangleEdge or null."); } else { RectangleEdge edge = (RectangleEdge) key; if (edge == RectangleEdge.TOP) { this.topBlock = block; } else if (edge == RectangleEdge.BOTTOM) { this.bottomBlock = block; } else if (edge == RectangleEdge.LEFT) { this.leftBlock = block; } else if (edge == RectangleEdge.RIGHT) { this.rightBlock = block; } } } BorderArrangement(); @Override void add(Block block, Object key); @Override Size2D arrange(BlockContainer container, Graphics2D g2,
                          RectangleConstraint constraint); @Override void clear(); @Override boolean equals(Object obj);  }### Answer:
@Test(expected=IllegalArgumentException.class) public void testAddWrongEdgeType() { BorderArrangement b1 = new BorderArrangement(); b1.add(new EmptyBlock(1.0, 1.0), "Hello"); }
@Test public void testAddCorrectEdgeType() { BorderArrangement b1 = new BorderArrangement(); b1.add(new EmptyBlock(1.0, 1.0), RectangleEdge.TOP); b1.add(new EmptyBlock(1.0, 1.0), RectangleEdge.BOTTOM); b1.add(new EmptyBlock(1.0, 1.0), RectangleEdge.LEFT); b1.add(new EmptyBlock(1.0, 1.0), RectangleEdge.RIGHT); b1.add(new EmptyBlock(1.0, 1.0), null); }