class Matchers {

  public static void checkUpperSnakeCase(String input, String resource)
      throws IllegalArgumentException {
    if (!UPPER_SNAKE_CASE_REGEX.matcher(input).matches()) {
      throw new IllegalArgumentException(
          String.format(
              ERROR_MESSAGE_TEMPLATE,
              resource,
              input,
              "argument must be in upper snake case, and cannot include any special characters."));
    }
  }

}

class MatchersTest {

  @Rule public final ExpectedException exception;

  @Test
  public void checkUpperSnakeCaseShouldPassForLegitUpperSnakeCase() {

    String in = "REDIS_DB";
    checkUpperSnakeCase(in, "featureset");
  }

}