Program: 79500
Project: 79500
Buggy source:
@Override public void start(Collection<? extends Location> locations){
  super.start(locations);
  policy=new AbstractMembershipTrackingPolicy(MutableMap.of("String_Node_Str",getName() + "String_Node_Str")){
    @Override protected void onEntityChange(    Entity member){
    }
    @Override protected void onEntityAdded(    Entity member){
      serverAdded((MongoDBServer)member);
    }
    @Override protected void onEntityRemoved(    Entity member){
      serverRemoved((MongoDBServer)member);
    }
  }
;
  addPolicy(policy);
  policy.setGroup(this);
  for (  AttributeSensor<Long> sensor : SENSORS_TO_SUM)   addEnricher(Enrichers.builder().aggregating(sensor).publishing(sensor).fromMembers().computingSum().valueToReportIfNoSensors(null).defaultValueForUnreportedSensors(null).build());
  addEnricher(Enrichers.builder().aggregating(MongoDBServer.REPLICA_SET_PRIMARY_ENDPOINT).publishing(MongoDBServer.REPLICA_SET_PRIMARY_ENDPOINT).fromMembers().valueToReportIfNoSensors(null).computing(new Function<Collection<String>,String>(){
    @Override public String apply(    Collection<String> input){
      if (input == null || input.isEmpty())       return null;
      Set<String> distinct=MutableSet.of();
      for (      String endpoint : input)       if (!Strings.isBlank(endpoint))       distinct.add(endpoint);
      if (distinct.size() > 1)       LOG.warn("String_Node_Str" + MongoDBReplicaSetImpl.this + "String_Node_Str"+ distinct);
      return input.iterator().next();
    }
  }
).build());
  addEnricher(Enrichers.builder().aggregating(MongoDBServer.MONGO_SERVER_ENDPOINT).publishing(REPLICA_SET_ENDPOINTS).fromMembers().valueToReportIfNoSensors(null).computing(new Function<Collection<String>,List<String>>(){
    @Override public List<String> apply(    Collection<String> input){
      Set<String> endpoints=new TreeSet<String>();
      for (      String endpoint : input) {
        if (!Strings.isBlank(endpoint)) {
          endpoints.add(endpoint);
        }
      }
      return MutableList.copyOf(endpoints);
    }
  }
).build());
  subscribeToMembers(this,MongoDBServer.IS_PRIMARY_FOR_REPLICA_SET,new SensorEventListener<Boolean>(){
    @Override public void onEvent(    SensorEvent<Boolean> event){
      if (Boolean.TRUE == event.getValue())       setAttribute(PRIMARY_ENTITY,(MongoDBServer)event.getSource());
    }
  }
);
}

Fixed version (ground truth):
@Override public void start(Collection<? extends Location> locations){
  super.start(locations);
  policy=new AbstractMembershipTrackingPolicy(MutableMap.of("String_Node_Str",getName() + "String_Node_Str")){
    @Override protected void onEntityChange(    Entity member){
    }
    @Override protected void onEntityAdded(    Entity member){
      serverAdded((MongoDBServer)member);
    }
    @Override protected void onEntityRemoved(    Entity member){
      serverRemoved((MongoDBServer)member);
    }
  }
;
  addPolicy(policy);
  policy.setGroup(this);
  for (  AttributeSensor<Long> sensor : SENSORS_TO_SUM)   addEnricher(Enrichers.builder().aggregating(sensor).publishing(sensor).fromMembers().computingSum().valueToReportIfNoSensors(null).defaultValueForUnreportedSensors(null).build());
  addEnricher(Enrichers.builder().aggregating(MongoDBServer.REPLICA_SET_PRIMARY_ENDPOINT).publishing(MongoDBServer.REPLICA_SET_PRIMARY_ENDPOINT).fromMembers().valueToReportIfNoSensors(null).computing((Function)new Function<Collection<String>,String>(){
    @Override public String apply(    Collection<String> input){
      if (input == null || input.isEmpty())       return null;
      Set<String> distinct=MutableSet.of();
      for (      String endpoint : input)       if (!Strings.isBlank(endpoint))       distinct.add(endpoint);
      if (distinct.size() > 1)       LOG.warn("String_Node_Str" + MongoDBReplicaSetImpl.this + "String_Node_Str"+ distinct);
      return input.iterator().next();
    }
  }
).build());
  addEnricher(Enrichers.builder().aggregating(MongoDBServer.MONGO_SERVER_ENDPOINT).publishing(REPLICA_SET_ENDPOINTS).fromMembers().valueToReportIfNoSensors(null).computing((Function)new Function<Collection<String>,List<String>>(){
    @Override public List<String> apply(    Collection<String> input){
      Set<String> endpoints=new TreeSet<String>();
      for (      String endpoint : input) {
        if (!Strings.isBlank(endpoint)) {
          endpoints.add(endpoint);
        }
      }
      return MutableList.copyOf(endpoints);
    }
  }
).build());
  subscribeToMembers(this,MongoDBServer.IS_PRIMARY_FOR_REPLICA_SET,new SensorEventListener<Boolean>(){
    @Override public void onEvent(    SensorEvent<Boolean> event){
      if (Boolean.TRUE == event.getValue())       setAttribute(PRIMARY_ENTITY,(MongoDBServer)event.getSource());
    }
  }
);
}