@Test public void validateNameReturnsTrueOnValidNames() throws Exception { assertThat(validName("hello")).isTrue(); assertThat(validName("hello_world")).isTrue(); assertThat(validName("Hello-World")).isTrue(); assertThat(validName("foo.yml")).isTrue(); assertThat(validName("I_am_secret.yml")).isTrue(); assertThat(validName("I-am-secret.yml")).isTrue(); }
public static boolean validName(String name) { return !name.startsWith(".") && name.matches(VALID_NAME_PATTERN); }
Utilities { public static boolean validName(String name) { return !name.startsWith(".") && name.matches(VALID_NAME_PATTERN); } }
Utilities { public static boolean validName(String name) { return !name.startsWith(".") && name.matches(VALID_NAME_PATTERN); }  }
Utilities { public static boolean validName(String name) { return !name.startsWith(".") && name.matches(VALID_NAME_PATTERN); }  static boolean validName(String name); }
Utilities { public static boolean validName(String name) { return !name.startsWith(".") && name.matches(VALID_NAME_PATTERN); }  static boolean validName(String name); static final String VALID_NAME_PATTERN; }