Buggy code:
public class MongoStorageTest extends MongoStorageTestBase { private static TypeRegistry registry ; @ BeforeClass public static void setupRegistry ( ) throws ModelException { } @ AfterClass public static void clearRegistry ( ) { } private MongoStorage storage ; @ Override protected void setupStorage ( ) { } @ Test public void testCreateIndexWithOneKey ( ) throws Exception { } @ Test public void testCreateIndexWithTwoKeys ( ) throws Exception { } @ Test public void testDeleteSystemEntity ( ) throws Exception { } @ Test public void testDeleteSystemEntities ( ) throws Exception { } @ Test public void testRemoveByDate ( ) throws Exception { } @ Test public void deleteDomainEntityRemovesTheWholeEntityFromTheDatabase ( ) throws Exception { } @ Test ( expected = IllegalArgumentException . class ) public void deleteDomainEntityThrowsAnIllegalArgumentExceptionIfTheTypeIsNotAPrimitiveType ( ) throws Exception { } @ Test ( expected = NoSuchEntityException . class ) public void deleteDomainEntityThrowsANoSuchEntityExceptionWhenTheEntityCannotBeFound ( ) throws Exception { } @ SuppressWarnings ( "unchecked" ) @ Test public void deleteVariationRemovesTheVariantFromTheDatabase ( ) throws Exception { } private String createFieldName ( String prefix , String fieldName ) { } @ Test ( expected = NoSuchEntityException . class ) public void deleteVariationThrowsANoSuchEntityExceptionWhenTheVariationIsNotFound ( ) throws Exception { } @ Test ( expected = NoSuchEntityException . class ) public void deleteVariationThrowsANoSuchEntityExceptionWhenTheEntityIsNotFound ( ) throws Exception { } @ Test ( expected = IllegalArgumentException . class ) public void deleteVariationThrowsAnIllegalArgumentExceptionWhenTheTypeIsPrimitive ( ) throws Exception { } @ Test public void deleteRelationsOfEntityRemovesTheRelationsOfEntityFromTheDatabase ( ) throws Exception { } @ Test public void declineRelationsOfEntitySetAcceptedToFalseForTheSelectedVariationsAndSetsThePIDToNullAndIncreasesTheRevision ( ) throws Exception { Class < ProjectARelation > type = ProjectARelation . class ; String propertyName = String . format ( "%s:accepted" , TypeNames . getInternalName ( type ) ) ; Map < String , Object > propertiesWithValues = Maps . newHashMap ( ) ; propertiesWithValues . put ( propertyName , false ) ; propertiesWithValues . put ( PID , null ) ; storage . declineRelationsOfEntity ( type , DEFAULT_ID ) ; DBObject setQueryPart = queries . setPropertiesToValue ( propertiesWithValues ) ; DBObject incQueryPArt = queries . incrementRevision ( ) ; BasicDBObject query = new BasicDBObject ( ) ; query . putAll ( setQueryPart ) ; query . putAll ( incQueryPArt ) ; <START_BUG> verify ( dbCollection ) . update ( queries . selectRelationsByEntityId ( DEFAULT_ID ) , query ) ; <END_BUG> } @ Test ( expected = IllegalArgumentException . class ) public void declineRelationsOfEntityRemovesThrowsAnIllegalArgumentExceptionWhenTheRelationTypeIsPrimitive ( ) throws Exception { } @ Test public void testDeleteNonPersistent ( ) throws Exception { } @ Test public void doesVariationExistReturnsTrueWhenTheDomainEntityContainsTheVariation ( ) throws StorageException { } @ Test public void doesVariationExistReturnsFalseWhenTheDomainEntityDoesNotContainTheVariation ( ) throws Exception { } @ Test public void doesVariationExistReturnsFalseWhenTheDomainEntityDoesNotExist ( ) throws Exception { } @ Test public void testGetItemForSystemEntity ( ) throws Exception { } @ Test public void testGetItemForDomainEntity ( ) throws Exception { } @ Test public void testGetSystemEntities ( ) throws Exception { } @ Test public void testGetPrimitiveDomainEntities ( ) throws Exception { } @ Test public void testGetProjectDomainEntities ( ) throws Exception { } @ Test ( expected = IllegalArgumentException . class ) public void testGetAllVariationsOfNonPrimitive ( ) throws Exception { } @ Test public void testGetAllVariationsWithoutRelations ( ) throws Exception { } @ Test public void testGetRevision ( ) throws Exception { } @ Test public void testGetAllRevisions ( ) throws Exception { } @ Test public void testGetRelationsByType ( ) throws Exception { } }

Fix:
verify ( dbCollection ) . update ( queries . selectRelationsByEntityId ( DEFAULT_ID ) , query , false , true ) ;