@Test public void testIsQueryableByPrimitiveRelationsWithSingleNonPrimitiveEntity() throws Exception { simpleSocialNetwork.users.add(user1); State initialState = createStateFromCurrentSimpleSocialNetwork(); for (int i=0; i<2; i++) { MethodId method = new MethodId(User.class, "setAgeInTwoCollections", Collection.class, Integer.TYPE, Collection.class, Integer.TYPE); NonPrimitiveArgument usersInArgs = i==0 ? new NonPrimitiveArgument() : new NonPrimitiveArgument(initialState.getEntityId(user1)); MethodCall fc = new MethodCall(method, initialState.getEntityId(user1), usersInArgs, new PrimitiveArgument(3), usersInArgs, new PrimitiveArgument(3)); assertTrue(generateHit(initialState, fc).isQueryableByPrimitiveRelations()); } }
public boolean isQueryableByPrimitiveRelations() { Collection<KBTriple> primitiveTriples = initialState.getGraphKb().getTriples().stream() .filter(triple -> triple.secondEntity instanceof PrimitiveEntity) .collect(Collectors.toList()); Set<String> idsOfNonPrimitiveEntitiesInPrimitiveRelations = primitiveTriples.stream() .map(triple -> initialState.getEntityId(triple.firstEntity)) .collect(Collectors.toSet()); return methodCall.getArguments().stream() .filter(arg->arg instanceof NonPrimitiveArgument) .noneMatch(arg -> aux_someEntityInterfereWithDescribingAnEntityInArg((NonPrimitiveArgument)arg, primitiveTriples, idsOfNonPrimitiveEntitiesInPrimitiveRelations)); }
Hit implements Serializable { public boolean isQueryableByPrimitiveRelations() { Collection<KBTriple> primitiveTriples = initialState.getGraphKb().getTriples().stream() .filter(triple -> triple.secondEntity instanceof PrimitiveEntity) .collect(Collectors.toList()); Set<String> idsOfNonPrimitiveEntitiesInPrimitiveRelations = primitiveTriples.stream() .map(triple -> initialState.getEntityId(triple.firstEntity)) .collect(Collectors.toSet()); return methodCall.getArguments().stream() .filter(arg->arg instanceof NonPrimitiveArgument) .noneMatch(arg -> aux_someEntityInterfereWithDescribingAnEntityInArg((NonPrimitiveArgument)arg, primitiveTriples, idsOfNonPrimitiveEntitiesInPrimitiveRelations)); } }
Hit implements Serializable { public boolean isQueryableByPrimitiveRelations() { Collection<KBTriple> primitiveTriples = initialState.getGraphKb().getTriples().stream() .filter(triple -> triple.secondEntity instanceof PrimitiveEntity) .collect(Collectors.toList()); Set<String> idsOfNonPrimitiveEntitiesInPrimitiveRelations = primitiveTriples.stream() .map(triple -> initialState.getEntityId(triple.firstEntity)) .collect(Collectors.toSet()); return methodCall.getArguments().stream() .filter(arg->arg instanceof NonPrimitiveArgument) .noneMatch(arg -> aux_someEntityInterfereWithDescribingAnEntityInArg((NonPrimitiveArgument)arg, primitiveTriples, idsOfNonPrimitiveEntitiesInPrimitiveRelations)); } Hit(String id, Domain domain, State initialState, State destinationState, MethodCall methodCall,
               StateVisualizer initialStateVisualizer, StateVisualizer desiredStateVisualizer, ZonedDateTime creationTime);  Hit(Domain domain, State initialState, State destinationState, MethodCall methodCall,
               StateVisualizer initialStateVisualizer, StateVisualizer desiredStateVisualizer, String idPrefix,
               ZonedDateTime creationTime); }
Hit implements Serializable { public boolean isQueryableByPrimitiveRelations() { Collection<KBTriple> primitiveTriples = initialState.getGraphKb().getTriples().stream() .filter(triple -> triple.secondEntity instanceof PrimitiveEntity) .collect(Collectors.toList()); Set<String> idsOfNonPrimitiveEntitiesInPrimitiveRelations = primitiveTriples.stream() .map(triple -> initialState.getEntityId(triple.firstEntity)) .collect(Collectors.toSet()); return methodCall.getArguments().stream() .filter(arg->arg instanceof NonPrimitiveArgument) .noneMatch(arg -> aux_someEntityInterfereWithDescribingAnEntityInArg((NonPrimitiveArgument)arg, primitiveTriples, idsOfNonPrimitiveEntitiesInPrimitiveRelations)); } Hit(String id, Domain domain, State initialState, State destinationState, MethodCall methodCall,
               StateVisualizer initialStateVisualizer, StateVisualizer desiredStateVisualizer, ZonedDateTime creationTime);  Hit(Domain domain, State initialState, State destinationState, MethodCall methodCall,
               StateVisualizer initialStateVisualizer, StateVisualizer desiredStateVisualizer, String idPrefix,
               ZonedDateTime creationTime); State getDestinationState(); @Override boolean equals(Object obj); @Override int hashCode(); String getId(); State getInitialState(); HitConstructionInfo getHitConstructionInfo(); MethodCall getMethodCall(); Domain getDomain(); PngFileInMemo createInitialAndDesiredStatesFigure(HitConstructionSettings hitConstructionSettings); boolean isQueryableByPrimitiveRelations(); boolean containsArgQueryableByComparisonOperation(); boolean containsArgQueryableBySuperlativeOperation(); String extractBatchIdFromHitIdAssumingExpectedFormat(); @Override String toString(); }
Hit implements Serializable { public boolean isQueryableByPrimitiveRelations() { Collection<KBTriple> primitiveTriples = initialState.getGraphKb().getTriples().stream() .filter(triple -> triple.secondEntity instanceof PrimitiveEntity) .collect(Collectors.toList()); Set<String> idsOfNonPrimitiveEntitiesInPrimitiveRelations = primitiveTriples.stream() .map(triple -> initialState.getEntityId(triple.firstEntity)) .collect(Collectors.toSet()); return methodCall.getArguments().stream() .filter(arg->arg instanceof NonPrimitiveArgument) .noneMatch(arg -> aux_someEntityInterfereWithDescribingAnEntityInArg((NonPrimitiveArgument)arg, primitiveTriples, idsOfNonPrimitiveEntitiesInPrimitiveRelations)); } Hit(String id, Domain domain, State initialState, State destinationState, MethodCall methodCall,
               StateVisualizer initialStateVisualizer, StateVisualizer desiredStateVisualizer, ZonedDateTime creationTime);  Hit(Domain domain, State initialState, State destinationState, MethodCall methodCall,
               StateVisualizer initialStateVisualizer, StateVisualizer desiredStateVisualizer, String idPrefix,
               ZonedDateTime creationTime); State getDestinationState(); @Override boolean equals(Object obj); @Override int hashCode(); String getId(); State getInitialState(); HitConstructionInfo getHitConstructionInfo(); MethodCall getMethodCall(); Domain getDomain(); PngFileInMemo createInitialAndDesiredStatesFigure(HitConstructionSettings hitConstructionSettings); boolean isQueryableByPrimitiveRelations(); boolean containsArgQueryableByComparisonOperation(); boolean containsArgQueryableBySuperlativeOperation(); String extractBatchIdFromHitIdAssumingExpectedFormat(); @Override String toString();  }