layout.setExpandRatio(first, ratio);
layout.setExpandRatio(second, 1);
AbstractComponent replace = new AbstractComponent() {
};
layout.replaceComponent(first, replace);
Assert.assertEquals("Expand ratio for replaced component is not "
+ "the same as for previous one", ratio,
layout.getExpandRatio(replace), 0.0001);
}