JPanel c1 = new JPanel();
c1.setMinimumSize(new Dimension(10, 10));
c1.setPreferredSize(new Dimension(20, 20));
c1.setMaximumSize(new Dimension(30, 30));
c.add(c1);
OverlayLayout l = new OverlayLayout(c);
h.check(l.preferredLayoutSize(c).width, 20);
h.check(l.preferredLayoutSize(c).height, 20);
}