CaptchaBuilder { public static BufferedImage buildImageWithCollapsedChallenge(CaptchaMetadata captchaMetadata) { if (captchaMetadata == null) throw new IllegalArgumentException("CaptchaMetadata object cannot be null"); if (captchaMetadata.getCaptchaDimension().getWidth() >= captchaMetadata.getCaptchaDimension().getHeight()) { return buildHorizontalCAPTCHA(captchaMetadata); } else { return buildVerticalCAPTCHA(captchaMetadata); } }  static BufferedImage buildImageWithCollapsedChallenge(CaptchaMetadata captchaMetadata);  }
@Test public void testBuildImageWithCollapsedChallengeHorizontal() throws Exception { BufferedImage bi = CaptchaBuilder.buildImageWithCollapsedChallenge(captchaMetadata); assertNotNull(bi); assertEquals(200, bi.getWidth()); assertEquals(100, bi.getHeight()); }