### Question:
DOBGenerator { public String generate(String format, int age){ if (age < 0) throw new IllegalArgumentException("Age must be a non-negative value"); SimpleDateFormat sdf = new SimpleDateFormat(format); Calendar cal = Calendar.getInstance(); Random random = new SecureRandom(); cal.add(Calendar.YEAR, -age); cal.add(Calendar.DAY_OF_YEAR, -random.nextInt(365)); return sdf.format(cal.getTime()); }  String generate(String format, int age); String generate(String format, int min, int max); String generate(int min, int max); String generate(int age); String generate(); String generate(String format);  }### Answer:
@Test public void testDOBGenerator(){ DOBGenerator dobGenerator = new DOBGenerator(); String result = dobGenerator.generate(); Assert.assertNotNull(result); String exactAge = dobGenerator.generate(30); Assert.assertNotNull(exactAge); }