void (Splitter splitter) { Dimension firstSize = splitter.getFirstComponent().getSize(); Dimension secondSize = splitter.getSecondComponent().getSize(); if (splitter.getOrientation()) { assertTrue(firstSize.height >= 0 && secondSize.height >= 0); } else { assertTrue(firstSize.width >= 0 && secondSize.width >= 0); } // In case there is no room for components or proportion is set to the value that is unreachable in UI // one of components (1st or 2nd according to strategy) may become zero-sized and we shouldn't do any checks then if (splitter.getOrientation() && (firstSize.height == 0 || secondSize.height == 0)) return; if (!splitter.getOrientation() && (firstSize.width == 0 || secondSize.width == 0)) return; Dimension size = splitter.getSize(); if(splitter.getOrientation()) { // Split horizontally assertEquals(size.height, firstSize.height + splitter.getDividerWidth() + secondSize.height); assertTrue(firstSize.width == size.width && secondSize.width == size.width); } else { assertEquals(size.width, firstSize.width + splitter.getDividerWidth() + secondSize.width); assertTrue(firstSize.height == size.height && secondSize.height == size.height); } if(splitter.isHonorMinimumSize()) { Dimension firstMinimum = splitter.getFirstComponent().getMinimumSize(); Dimension secondMinimum = splitter.getSecondComponent().getMinimumSize(); switch (splitter.getLackOfSpaceStrategy()) { case SIMPLE_RATIO -> { assertEquals(firstSize.width < firstMinimum.width, secondSize.width < secondMinimum.width); assertEquals(firstSize.height < firstMinimum.height, secondSize.height < secondMinimum.height); } case HONOR_THE_FIRST_MIN_SIZE -> assertTrue(splitter.getOrientation() ? firstSize.height >= firstMinimum.height : firstSize.width >= firstMinimum.width); case HONOR_THE_SECOND_MIN_SIZE -> assertTrue(splitter.getOrientation() ? secondSize.height >= secondMinimum.height : secondSize.width >= secondMinimum.width); } } }