Env { public static long getLong(String name, long defaultValue) { return Stream.of(name) .map(Env::normalizeKey) .map(envMap::get) .filter(Objects::nonNull) .findFirst() .map(Long::parseLong) .orElse(defaultValue); }  static String get(String name); static String getString(String name, String defaultValue); static int getInt(String name, int defaultValue); static long getLong(String name, long defaultValue);  }
@Test public void fromFile() { assertThat(Env.getLong("aaa.bbb", 3)).isEqualTo(1234); assertThat(Env.getLong("ccc.ddd", 0)).isEqualTo(5678); }