MemoryProjectStore implements ProjectStore { public void setProjects( Collection<Project> projects ) { this.projects.clear(); for ( Project p : projects ) { this.projects.put( p.getId(), p ); } }  Collection<Project> getAllProjects(); void setProjects( Collection<Project> projects ); Project getProjectById( String id ); void store( Project project );  }
@Test public void testSetProjects() { MemoryProjectStore store = new MemoryProjectStore(); Project project1 = new Project(); project1.setId( "id" ); Project project2 = new Project(); project2.setId( "id2" ); List<Project> projects = Arrays.asList( project1, project2 ); store.setProjects( projects ); assert projects.size() == 2; assert projects.contains( project1 ); assert projects.contains( project2 ); }