### Question:
JdbcProjectImpl implements ProjectLoader { @Override public Project fetchProjectById(final int id) throws ProjectManagerException { Project project = null; final List<Integer> ids = Collections.singletonList(id); try { final List<Project> projects = fetchProjectById(ids); if (projects == null || projects.isEmpty()) { throw new ProjectManagerException("No project with id " + id + " exists in db."); } project = projects.get(0); } catch (final ProjectManagerException ex) { throw new ProjectManagerException("Query for existing project failed. Project " + id, ex); } return project; } @Inject  JdbcProjectImpl(final Props props, final DatabaseOperator databaseOperator); @Override List<Project> fetchAllActiveProjects(); @Override Project fetchProjectById(final int id); @Override Project fetchProjectByName(final String name); @Override synchronized Project createNewProject(final String name, final String description,
      final User creator); @Override void uploadProjectFile(final int projectId, final int version, final File localFile,
      final String uploader, final String uploaderIPAddr); @Override void addProjectVersion(final int projectId, final int version, final File localFile,
      final File startupDependencies, final String uploader, final byte[] md5,
      final String resourceId, final String uploaderIPAddr); @Override ProjectFileHandler fetchProjectMetaData(final int projectId, final int version); @Override ProjectFileHandler getUploadedFile(final int projectId, final int version); @Override void changeProjectVersion(final Project project, final int version, final String user); @Override void updatePermission(final Project project, final String name, final Permission perm,
      final boolean isGroup); @Override void updateProjectSettings(final Project project); @Override void removePermission(final Project project, final String name, final boolean isGroup); @Override void removeProject(final Project project, final String user); @Override boolean postEvent(final Project project, final EventType type, final String user,
      final String message); @Override List<ProjectLogEvent> getProjectEvents(final Project project, final int num,
      final int skip); @Override void updateDescription(final Project project, final String description, final String user); @Override int getLatestProjectVersion(final Project project); @Override void uploadFlows(final Project project, final int version, final Collection<Flow> flows); @Override void uploadFlow(final Project project, final int version, final Flow flow); @Override void updateFlow(final Project project, final int version, final Flow flow); @Override Flow fetchFlow(final Project project, final String flowId); @Override List<Flow> fetchAllProjectFlows(final Project project); @Override Map<Project, List<Flow>> fetchAllFlowsForProjects(final List<Project> projects); @Override void uploadProjectProperties(final Project project, final List<Props> properties); @Override void uploadProjectProperty(final Project project, final Props props); @Override void updateProjectProperty(final Project project, final Props props); @Override Props fetchProjectProperty(final int projectId, final int projectVer,
      final String propsName); @Override Props fetchProjectProperty(final Project project, final String propsName); @Override Map<String, Props> fetchProjectProperties(final int projectId, final int version); @Override void cleanOlderProjectVersion(final int projectId, final int version,
      final List<Integer> excludedVersions); @Override void uploadFlowFile(final int projectId, final int projectVersion, final File flowFile,
      final int flowVersion); @Override File getUploadedFlowFile(final int projectId, final int projectVersion,
      final String flowFileName, final int flowVersion, final File tempDir); @Override int getLatestFlowVersion(final int projectId, final int projectVersion,
      final String flowName); @Override boolean isFlowFileUploaded(final int projectId, final int projectVersion); @Override List<Project> fetchProjectById(final List<Integer> ids);  }### Answer:
@Test public void testFetchProjectById() throws Exception { createThreeProjects(); final Project project1 = this.loader.fetchProjectByName("mytestProject"); final Project project2 = this.loader.fetchProjectById(project1.getId()); Assert.assertEquals(project1.getName(), project2.getName()); Assert.assertEquals(project1.getDescription(), project2.getDescription()); Assert.assertEquals(project1.getLastModifiedUser(), project2.getLastModifiedUser()); }