package test.mesolevel.newsynapsecreation;
...
import java.util.*;
import repast.simphony.*;
...
public class NewSynapseCreationTester 
                               extends TesterAgent {
  private Neuron n1, n2, n3;
  private TestEnvironment testEnv;

  public NewSynapseCreationTester() {
    this.testEnv = getTestEnvironment();
    this.n1 = (Neuron) testEnv.getAgent("Neuron-1");	
    this.n2 = (Neuron) testEnv.getAgent("Neuron-2");
    this.n3 = (Neuron) testEnv.getAgent("Neuron-3");
  }

  @ScheduledMethod(start = 1, 
       priority = ScheduleParameters.LAST_PRIORITY)
  public void testInitialOrganization() {    
    List<Agent> agents = 
                   testEnv.getAgents(Neuron.class);	
    assertEquals(3, agents.size());
    // Neuron-1
    assertEquals(0, n1.getPreSynapses().size());
    assertEquals(1, n1.getPostSynapses().size());
    // Neuron-2
    assertEquals(1, n2.getPreSynapses().size());
    assertEquals(1, n2.getPostSynapses().size());
    // Neuron-3
    assertEquals(1, n3.getPreSynapses().size());
    assertEquals(0, n3.getPostSynapses().size());
 }

 @ScheduledMethod(start = ScheduleParameters.END, 
       priority = ScheduleParameters.LAST_PRIORITY)
 public void testCreationOfANewSynapse() { 
   List<Agent> agents = 
                   testEnv.getAgents(Neuron.class);	
   assertEquals(3, agents.size());
   // Neuron-1
   assertEquals(0, n1.getPreSynapses().size());
   assertEquals(2, n1.getPostSynapses().size());
   // Neuron-2
   assertEquals(1, n2.getPreSynapses().size());
   assertEquals(1, n2.getPostSynapses().size());
   // Neuron-3
   assertEquals(2, n3.getPreSynapses().size());
   assertEquals(0, n3.getPostSynapses().size());
 }
}
