ImageChooser { public Optional<String> chooseImage(String osFamily, String osVersionRegex) { return chooseImage((osFamily == null ? (OsFamily) null : OsFamily.fromValue(osFamily)), osVersionRegex); } ImageChooser();  ImageChooser(List<? extends ImageMetadata> images); Optional<String> chooseImage(String osFamily, String osVersionRegex); Optional<String> chooseImage(OsFamily osFamily, String osVersionRegex);  }
@Test public void testDefault() { assertEquals(chooser.chooseImage((String) null, null).orNull(), "brooklyncentral/centos:7"); }
@Test public void testCentos() { assertEquals(chooser.chooseImage("cEnToS", null).orNull(), "brooklyncentral/centos:7"); }
@Test public void testCentos7() { assertEquals(chooser.chooseImage("cEnToS", "7").orNull(), "brooklyncentral/centos:7"); }
@Test public void testUbuntu() { assertEquals(chooser.chooseImage("uBuNtU", null).orNull(), "brooklyncentral/ubuntu:14.04"); }
@Test public void testUbuntu14() { assertEquals(chooser.chooseImage("uBuNtU", "14.*").orNull(), "brooklyncentral/ubuntu:14.04"); }
@Test public void testUbuntu16() { assertEquals(chooser.chooseImage("uBuNtU", "16.*").orNull(), "brooklyncentral/ubuntu:16.04"); }
@Test public void testUbuntu18() { assertEquals(chooser.chooseImage("uBuNtU", "18.*").orNull(), "brooklyncentral/ubuntu:18.04"); }
@Test public void testAbsentForCentos6() { assertFalse(chooser.chooseImage("cEnToS", "6").isPresent()); }
@Test public void testAbsentForUbuntu15() { assertFalse(chooser.chooseImage("uBuNtU", "15").isPresent()); }
@Test public void testAbsentForDebian() { assertFalse(chooser.chooseImage("debian", null).isPresent()); }
@Test public void testAbsentForWrongOsFamily() { assertFalse(chooser.chooseImage("weirdOsFamily", null).isPresent()); }