### Question:
DefaultQuotingStrategy implements QuotingStrategy { @Override public void quotedIdentifier(DataMap dataMap, CharSequence identifier, Appendable appender) { if (identifier == null) { return; } boolean quoting = dataMap != null && dataMap.isQuotingSQLIdentifiers(); try { if (quoting) { appender.append(startQuote).append(identifier).append(endQuote); } else { appender.append(identifier); } } catch (IOException ex) { throw new CayenneRuntimeException("Failed to append quoted identifier", ex); } } DefaultQuotingStrategy(String startQuote, String endQuote); @Override String quotedFullyQualifiedName(DbEntity entity); @Override String quotedName(DbAttribute attribute); @Override String quotedSourceName(DbJoin join); @Override String quotedTargetName(DbJoin join); @Override void quotedIdentifier(DataMap dataMap, CharSequence identifier, Appendable appender); @Override String quotedIdentifier(DataMap dataMap, String... identifierParts);  }### Answer:
@Test public void testQuotedIdentifier() { DataMap dm = new DataMap(); dm.setQuotingSQLIdentifiers(true); DbEntity de = new DbEntity(); de.setDataMap(dm); DefaultQuotingStrategy strategy = new DefaultQuotingStrategy("[", "]"); assertEquals("[a]", strategy.quotedIdentifier(de, "a")); assertEquals("[a]", strategy.quotedIdentifier(de, null, null, "a")); assertEquals("[c].[b].[a]", strategy.quotedIdentifier(de, "c", "b", "a")); }
@Test public void testUnQuotedIdentifier() { DataMap dm = new DataMap(); dm.setQuotingSQLIdentifiers(false); DbEntity de = new DbEntity(); de.setDataMap(dm); DefaultQuotingStrategy strategy = new DefaultQuotingStrategy("[", "]"); assertEquals("a", strategy.quotedIdentifier(de, "a")); assertEquals("a", strategy.quotedIdentifier(de, null, null, "a")); assertEquals("c.b.a", strategy.quotedIdentifier(de, "c", "b", "a")); }