MemoryProjectStore implements ProjectStore { public void store( Project project ) { projects.put( project.getId(), project ); }  Collection<Project> getAllProjects(); void setProjects( Collection<Project> projects ); Project getProjectById( String id ); void store( Project project );  }
@Test public void testStore() { MemoryProjectStore store = new MemoryProjectStore(); Project project = new Project(); project.setId( "id" ); store.store( project ); Collection<Project> projects = store.getAllProjects(); assert projects.size() == 1; assert project == projects.iterator().next(); assert project == store.getProjectById( "id" ); }