### Question:
FlashCapability { public static Flash toFlash(String code) { Flash flash = CODE_TO_FLASH.forward().get(code); if (flash == null) { return Flash.OFF; } return flash; }  static Flash toFlash(String code); static String toCode(Flash flash);  }### Answer:
@Test public void toFlash() throws Exception { Flash flash = FlashCapability.toFlash( Camera.Parameters.FLASH_MODE_AUTO ); assertEquals( Flash.AUTO, flash ); }
@Test public void toFlash_Unknown() throws Exception { Flash flash = FlashCapability.toFlash("whatever"); assertEquals( Flash.OFF, flash ); }