DialectUtils { public static String stripQuotes(Dialect dialect, String name) { String openQuote = dialect.openQuote(); String closeQuote = dialect.closeQuote(); if (startsWith(name, openQuote) && endsWith(name, closeQuote)) { name = substring(name, dialect.openQuote().length()); name = substring(name, 0, name.length() - closeQuote.length()); } return name; }  static String stripQuotes(Dialect dialect, String name); static final String NULL; }
@Test public void testStripQuotes() { assertEquals(stripQuotes(dialect, "'users'"), "users"); assertEquals(stripQuotes(dialect, "'users"), "'users"); assertEquals(stripQuotes(dialect, "users'"), "users'"); assertEquals(stripQuotes(dialect, "users"), "users"); }