private static void testToResourceName() {
    String[][] names = {
      // bundleName,   suffix, expected result
      {"com.sun.J2SE", "xml", "com/sun/J2SE.xml"},
      {".J2SE", "xml", "/J2SE.xml"},
      {"J2SE", "xml", "J2SE.xml"},
      {"com/sun/J2SE", "xml", "com/sun/J2SE.xml"},
      {"com.sun.J2SE", "", "com/sun/J2SE."},
      {".", "", "/."},
      {"", "", "."},

      // data for NPE tests
      {null, "any", null},
      {"any", null, null},
      {null, null, null},
    };

    for (String[] data : names) {
      String result = null;
      boolean npeThrown = false;
      try {
        result = CONTROL.toResourceName(data[0], data[1]);
      } catch (NullPointerException npe) {
        npeThrown = true;
      }
      String expected = data[2];
      if (expected != null) {
        if (!result.equals(expected)) {
          error("toResourceName: got %s, expected %s%n", result, data[2]);
        }
      } else {
        if (!npeThrown) {
          error("toResourceName(%s, %s) doesn't throw NPE.%n", data[0], data[1]);
        }
      }
    }
  }