### Question:
RdbmsReader extends AbstractRdbmsComponentRuntime { public static Map<Integer, String> getSqlColumnEntityHints(String sql) { Map<Integer, String> columnEntityHints = new HashMap<Integer, String>(); String columns = sql.substring(sql.toLowerCase().indexOf("select") + 6, getFromIndex(sql)); int commentIdx = 0; Set<String> used = new HashSet<>(); while (columns.indexOf("", commentIdx))); if (entity.contains(".")) { if (!used.contains(entity)) { used.add(entity); } else { throw new MisconfiguredException("The same hint was used twice. " + "Only one column can map to an entity attribute. " + "The hint that was repeated was for " + entity); } } columnEntityHints.put(columnIdx, entity); } return columnEntityHints; }  @Override void start(); @Override boolean supportsStartupMessages(); @Override void handle(final Message inputMessage, final ISendMessageCallback callback, boolean unitOfWorkBoundaryReached); static Map<Integer, String> getSqlColumnEntityHints(String sql); void setSqls(List<String> sqls); void setSql(String sql); void setRowsPerMessage(long rowsPerMessage); void setMatchOnColumnNameOnly(boolean matchOnColumnNameOnly); void setTrimColumns(boolean trimColumns); void setEntityChangeType(ChangeType entityChangeType); int getRowReadDuringHandle(); void setRunWhen(String runWhen); static final String TYPE; final static String TRIM_COLUMNS; final static String MATCH_ON_COLUMN_NAME_ONLY; final static String PASS_INPUT_ROWS_THROUGH; final static String RUN_WHEN; final static String UNIT_OF_WORK; static final String COMPONENT_LIFETIME; static final String SQL_SCRIPT; static final String SQL_STATEMENT; }### Answer:
@Test public void testGetSqlColumnEntityHints() throws Exception { String sql = "select\r\n ISNULL(a,ISNULL(z,'')) , 'lastName, firstName', c, d from test;"; Map<Integer, String> hints = RdbmsReader.getSqlColumnEntityHints(sql); assertEquals(hints.get(1), "COLA"); assertEquals(hints.get(2), "COLB"); assertEquals(hints.get(3), "COLC"); assertEquals(hints.get(4), "\"COL D\""); String dupeAtribSQL = "select" + " a " + " , b " + " , c " + "from test;"; boolean errorFound = false; try { RdbmsReader.getSqlColumnEntityHints(dupeAtribSQL); } catch(MisconfiguredException e) { errorFound = true; } assertEquals(errorFound,true); String dupeEntitySQL = "select" + " a " + " , b " + " , c " + "from test;"; errorFound = false; try { RdbmsReader.getSqlColumnEntityHints(dupeEntitySQL); } catch(MisconfiguredException e) { errorFound = true; } assertEquals(errorFound,false); }