@Test
public void toPascalCase() {

    assertNull(StringUtil.toPascalCase(null));
    assertEquals("", StringUtil.toPascalCase(""));
    assertEquals("A", StringUtil.toPascalCase("A"));
    assertEquals("A", StringUtil.toPascalCase("a"));
    assertEquals("Ab", StringUtil.toPascalCase("AB"));
    assertEquals("Ab", StringUtil.toPascalCase("Ab"));
    assertEquals("AB", StringUtil.toPascalCase("aB"));
    assertEquals("Ab", StringUtil.toPascalCase("ab"));
    assertEquals("AB", StringUtil.toPascalCase("A_B"));
    assertEquals("AB", StringUtil.toPascalCase("A_b"));
    assertEquals("AB", StringUtil.toPascalCase("a_B"));
    assertEquals("AB", StringUtil.toPascalCase("a_b"));
    assertEquals("ABc", StringUtil.toPascalCase("aBc"));
    assertEquals("ABcDef", StringUtil.toPascalCase("  aBc def "));
    assertEquals("ABcDef", StringUtil.toPascalCase("aBcDef"));
    assertEquals("ABcDefGhi", StringUtil.toPascalCase("aBc def_ghi"));
    assertEquals("ABcDefGhi", StringUtil.toPascalCase("aBcDefGhi"));
    assertEquals("ABcDefGhi123", StringUtil.toPascalCase("aBc def_ghi 123"));
    assertEquals("ABcDefGhi123", StringUtil.toPascalCase("aBcDefGhi123"));
    assertEquals("ABcDefGhi123", StringUtil.toPascalCase("aBcDEFGhi123"));
    assertEquals("123ABcDefGhi", StringUtil.toPascalCase("123aBcDEFGhi")); // 数字开始
    // 不保留下划线
    assertEquals("Ab", StringUtil.toPascalCase("__AB__"));
    assertEquals("Ab", StringUtil.toPascalCase("__Ab__"));
    assertEquals("AB", StringUtil.toPascalCase("__aB__"));
    assertEquals("Ab", StringUtil.toPascalCase("__ab__"));
    assertEquals("AB", StringUtil.toPascalCase("__A__B__"));
    assertEquals("AB", StringUtil.toPascalCase("__A__b__"));
    assertEquals("AB", StringUtil.toPascalCase("__a__B__"));
    assertEquals("AB", StringUtil.toPascalCase("__a__b__"));
    // 保留除下划线以外的其它分隔符
    assertEquals("..Ab..", StringUtil.toPascalCase("..AB.."));
    assertEquals("..Ab..", StringUtil.toPascalCase("..Ab.."));
    assertEquals("..AB..", StringUtil.toPascalCase("..aB.."));
    assertEquals("..Ab..", StringUtil.toPascalCase("..ab.."));
    assertEquals("..A..B..", StringUtil.toPascalCase("..A..B.."));
    assertEquals("..A..B..", StringUtil.toPascalCase("..A..b.."));
    assertEquals("..A..B..", StringUtil.toPascalCase("..a..B.."));
    assertEquals("..A..B..", StringUtil.toPascalCase("..a..b.."));
    assertEquals("..A..123B..", StringUtil.toPascalCase("..A..123B.."));
    assertEquals("..A..123B..", StringUtil.toPascalCase("..A..123b.."));
    assertEquals("..A..123B..", StringUtil.toPascalCase("..a..123B.."));
    assertEquals("..A..123B..", StringUtil.toPascalCase("..a..123b.."));
    assertEquals("Fmh.M.0.N", StringUtil.toPascalCase("_fmh.m._0.n"));
    assertEquals("Aaa-Bbb-Ccc", StringUtil.toPascalCase("aaa-bbb-ccc"));
}