@Test
  public void testTableNames() throws IOException {
    byte[][] illegalNames = new byte[][] { Bytes.toBytes("-bad"), Bytes.toBytes(".bad") };
    for (byte[] illegalName : illegalNames) {
      assertThrows(
        "Did not detect '" + Bytes.toString(illegalName) + "' as an illegal user table name",
        IllegalArgumentException.class, () -> TableName.valueOf(illegalName));
    }
    byte[] legalName = Bytes.toBytes("g-oo.d");
    try {
      TableName.valueOf(legalName);
    } catch (IllegalArgumentException e) {
      fail("Legal user table name: '" + Bytes.toString(legalName)
        + "' caused IllegalArgumentException: " + e.getMessage());
    }
  }
Test that user table names can contain '-' and '.' so long as they do not start with same.
HBASE-771
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java