### Question:
JdbcDelegate implements DatabaseDelegate { public List<String> getNodeIds() throws DatabaseException { Connection con = null; PreparedStatement ps = null; try { con = getConnection(); ps = con.prepareStatement(GET_NODEIDS, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); ResultSet rs = ps.executeQuery(); ArrayList<String> nodes = new ArrayList<String>(); while (rs.next()) { String nodeId = rs.getString(1); if (nodeId != null) nodes.add(rs.getString(1)); } if (__log.isDebugEnabled()) __log.debug("getNodeIds: " + nodes); return nodes; } catch (SQLException se) { throw new DatabaseException(se); } finally { close(ps); close(con); } } JdbcDelegate(DataSource ds); boolean deleteJob(String jobid, String nodeId); List<String> getNodeIds(); boolean insertJob(Job job, String nodeId, boolean loaded); boolean updateJob(Job job); @SuppressWarnings("unchecked") List<Job> dequeueImmediate(String nodeId, long maxtime, int maxjobs); int updateReassign(String oldnode, String newnode); int updateAssignToNode(String node, int i, int numNodes, long maxtime); void acquireTransactionLocks(); void deleteAllJobs();  }### Answer:
@Test public void testGetNodeIds() throws Exception { List<String> nids = _del.getNodeIds(); assertNotNull(nids); assertEquals(0, nids.size()); _del.insertJob(new Job(0L,true,new Scheduler.JobDetails()), "abc", true); nids = _del.getNodeIds(); assertEquals(1, nids.size()); assertTrue(nids.contains("abc")); _del.insertJob(new Job(0L,true,new Scheduler.JobDetails()), "abc", true); nids = _del.getNodeIds(); assertEquals(1, nids.size()); assertTrue(nids.contains("abc")); _del.insertJob(new Job(0L,true,new Scheduler.JobDetails()), "123", true); nids = _del.getNodeIds(); assertEquals(2, nids.size()); assertTrue(nids.contains("abc")); assertTrue(nids.contains("123")); }