public void testThreeColumnsProportionallySized() throws Exception {
columnLayout.setAutoSizeColumns(false);
columnLayout.setColumnWidths(0.5f, 0.2f, 0.3f);
when(canvas.calculateRestrictedSize(eq(itemAt1x1), any(Vector2i.class))).thenReturn(new Vector2i(50, 10));
when(canvas.calculateRestrictedSize(eq(itemAt2x1), any(Vector2i.class))).thenReturn(new Vector2i(5, 5));
when(canvas.calculateRestrictedSize(eq(itemAt3x1), any(Vector2i.class))).thenReturn(new Vector2i(10, 10));
when(canvas.calculateRestrictedSize(eq(itemAt1x2), any(Vector2i.class))).thenReturn(new Vector2i(20, 10));
when(canvas.calculateRestrictedSize(eq(itemAt2x2), any(Vector2i.class))).thenReturn(new Vector2i(5, 5));
when(canvas.calculateRestrictedSize(eq(itemAt3x2), any(Vector2i.class))).thenReturn(new Vector2i(20, 10));
Vector2i availableSize = new Vector2i(200, 200);
Vector2i result = columnLayout.getPreferredContentSize(canvas, availableSize);
// This is the size of the first column divided by its ratio.
// In general, the minimum column size / ratio guarantees the ration
// and insures that every column has at least as much as its preferred size
assertEquals(100, result.x);
assertEquals(20, result.y);