@Test public void generates_single_password_if_date_interval_just_one_date() { LocalDate d1 = LocalDate.of(2016, 1, 5); LocalDate d2 = LocalDate.of(2016, 1, 5); Map<LocalDate, String> potd_list = Arrispwgen.generate_multi(d1, d2, DEFAULT_SEED); assertEquals(1, potd_list.size()); }
static Map<LocalDate, String> generate_multi(LocalDate start_date, LocalDate end_date, String seed) { if (start_date.isAfter(end_date)) { throw new IllegalArgumentException(); } int days = (int) (1 + ChronoUnit.DAYS.between(start_date, end_date)); Map<LocalDate, String> password_list = new HashMap<>(); LocalDate date = start_date; for (int i = 0; i < days; i++) { password_list.put(date, generate(date, seed)); date = date.plusDays(1); } return password_list; }
Arrispwgen { static Map<LocalDate, String> generate_multi(LocalDate start_date, LocalDate end_date, String seed) { if (start_date.isAfter(end_date)) { throw new IllegalArgumentException(); } int days = (int) (1 + ChronoUnit.DAYS.between(start_date, end_date)); Map<LocalDate, String> password_list = new HashMap<>(); LocalDate date = start_date; for (int i = 0; i < days; i++) { password_list.put(date, generate(date, seed)); date = date.plusDays(1); } return password_list; } }
Arrispwgen { static Map<LocalDate, String> generate_multi(LocalDate start_date, LocalDate end_date, String seed) { if (start_date.isAfter(end_date)) { throw new IllegalArgumentException(); } int days = (int) (1 + ChronoUnit.DAYS.between(start_date, end_date)); Map<LocalDate, String> password_list = new HashMap<>(); LocalDate date = start_date; for (int i = 0; i < days; i++) { password_list.put(date, generate(date, seed)); date = date.plusDays(1); } return password_list; }  }
Arrispwgen { static Map<LocalDate, String> generate_multi(LocalDate start_date, LocalDate end_date, String seed) { if (start_date.isAfter(end_date)) { throw new IllegalArgumentException(); } int days = (int) (1 + ChronoUnit.DAYS.between(start_date, end_date)); Map<LocalDate, String> password_list = new HashMap<>(); LocalDate date = start_date; for (int i = 0; i < days; i++) { password_list.put(date, generate(date, seed)); date = date.plusDays(1); } return password_list; }   }
Arrispwgen { static Map<LocalDate, String> generate_multi(LocalDate start_date, LocalDate end_date, String seed) { if (start_date.isAfter(end_date)) { throw new IllegalArgumentException(); } int days = (int) (1 + ChronoUnit.DAYS.between(start_date, end_date)); Map<LocalDate, String> password_list = new HashMap<>(); LocalDate date = start_date; for (int i = 0; i < days; i++) { password_list.put(date, generate(date, seed)); date = date.plusDays(1); } return password_list; }    }