Program: 93237
Project: 93237
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public List<Entity> add(FullEntity<?>... entities){
  if (entities.length == 0) {
    return Collections.emptyList();
  }
  List<com.google.datastore.v1beta3.Mutation> mutationsPb=new ArrayList<>();
  Map<Key,Entity> completeEntities=new LinkedHashMap<>();
  for (  FullEntity<?> entity : entities) {
    Entity completeEntity=null;
    if (entity.key() instanceof Key) {
      completeEntity=Entity.convert((FullEntity<Key>)entity);
    }
    if (completeEntity != null) {
      if (completeEntities.put(completeEntity.key(),completeEntity) != null) {
        throw DatastoreException.throwInvalidRequest("String_Node_Str",entity.key());
      }
      mutationsPb.add(com.google.datastore.v1beta3.Mutation.newBuilder().setInsert(completeEntity.toPb()).build());
    }
 else {
      Preconditions.checkArgument(entity.hasKey(),"String_Node_Str",entity);
      mutationsPb.add(com.google.datastore.v1beta3.Mutation.newBuilder().setInsert(entity.toPb()).build());
    }
  }
  com.google.datastore.v1beta3.CommitResponse commitResponse=commitMutation(mutationsPb);
  Iterator<com.google.datastore.v1beta3.MutationResult> mutationResults=commitResponse.getMutationResultsList().iterator();
  ImmutableList.Builder<Entity> responseBuilder=ImmutableList.builder();
  for (  FullEntity<?> entity : entities) {
    Entity completeEntity=completeEntities.get(entity.key());
    if (completeEntity != null) {
      responseBuilder.add(completeEntity);
      mutationResults.next();
    }
 else {
      responseBuilder.add(Entity.builder(Key.fromPb(mutationResults.next().getKey()),entity).build());
    }
  }
  return responseBuilder.build();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public List<Entity> add(FullEntity<?>... entities){
  if (entities.length == 0) {
    return Collections.emptyList();
  }
  List<com.google.datastore.v1beta3.Mutation> mutationsPb=new ArrayList<>();
  Set<Entity> completeEntities=new LinkedHashSet<>();
  for (  FullEntity<?> entity : entities) {
    Entity completeEntity=null;
    if (entity.key() instanceof Key) {
      completeEntity=Entity.convert((FullEntity<Key>)entity);
    }
    if (completeEntity != null) {
      if (completeEntities.contains(completeEntity)) {
        throw DatastoreException.throwInvalidRequest("String_Node_Str",entity.key());
      }
      completeEntities.add(completeEntity);
    }
 else {
      Preconditions.checkArgument(entity.hasKey(),"String_Node_Str",entity);
    }
    mutationsPb.add(com.google.datastore.v1beta3.Mutation.newBuilder().setInsert(entity.toPb()).build());
  }
  com.google.datastore.v1beta3.CommitResponse commitResponse=commitMutation(mutationsPb);
  Iterator<com.google.datastore.v1beta3.MutationResult> mutationResults=commitResponse.getMutationResultsList().iterator();
  Iterator<Entity> completeEntitiesIt=completeEntities.iterator();
  ImmutableList.Builder<Entity> responseBuilder=ImmutableList.builder();
  for (  FullEntity<?> entity : entities) {
    if (completeEntities.contains(entity)) {
      responseBuilder.add(completeEntitiesIt.next());
      mutationResults.next();
    }
 else {
      responseBuilder.add(Entity.builder(Key.fromPb(mutationResults.next().getKey()),entity).build());
    }
  }
  return responseBuilder.build();
}