@Test public void no_measure_if_there_is_no_qualitygate() { qualityGateHolder.setQualityGate(null); underTest.execute(new TestComputationStepContext()); measureRepository.getAddedRawMeasures(PROJECT_COMPONENT).isEmpty(); }
@Test public void no_measure_if_tree_has_no_project() { ReportComponent notAProjectComponent = ReportComponent.builder(Component.Type.DIRECTORY, 1).build(); treeRootHolder.setRoot(notAProjectComponent); underTest.execute(new TestComputationStepContext()); measureRepository.getAddedRawMeasures(1).isEmpty(); }
assertTrue(ArbitraryInstances.get(ListMultimap.class).isEmpty()); assertTrue(ArbitraryInstances.get(ImmutableListMultimap.class).isEmpty()); assertTrue(ArbitraryInstances.get(SetMultimap.class).isEmpty()); assertTrue(ArbitraryInstances.get(ImmutableSetMultimap.class).isEmpty()); assertTrue(ArbitraryInstances.get(MapDifference.class).areEqual());
protected static void writeContext(XContentBuilder builder, Set<Map<String, String>> contexts, String[] languages) throws IOException { final SetMultimap<String, String> multimap = HashMultimap.create(); for (Map<String, String> context : contexts) { if (context.get("name") != null) { multimap.put("default", context.get("name")); } } for (String language : languages) { for (Map<String, String> context : contexts) { if (context.get("name:" + language) != null) { multimap.put(language, context.get("name:" + language)); } } } final Map<String, Collection<String>> map = multimap.asMap(); if (!multimap.isEmpty()) { builder.startObject("context"); for (Map.Entry<String, Collection<String>> entry : map.entrySet()) { builder.field(entry.getKey(), commaJoiner.join(entry.getValue())); } builder.endObject(); } }
if (deleteQuery.getTags().isEmpty())
@Override public boolean isEmpty() { // both change sets are either NULL (never touched) or empty (touched and then cleared) if ((this.indexNameToAdditions == null || this.indexNameToAdditions.isEmpty()) && (this.indexNameToRemovals == null || this.indexNameToRemovals.isEmpty())) { return true; } else { return false; } }
public boolean isDirty() { return this.modifiedVertices.isEmpty() == false || this.modifiedEdges.isEmpty() == false || this.propertyNameToModifiedProperties.isEmpty() == false || this.modifiedVariables.isEmpty() == false; }
@Override public boolean isSubtractive() { if (this.indexNameToRemovals != null && this.indexNameToRemovals.size() > 0) { if (this.indexNameToAdditions == null || this.indexNameToAdditions.isEmpty()) { return true; } } return false; }
private void register(ConnectPoint connectPoint, HandlerRegistration registration) { synchronized (packetHandlers) { if (packetHandlers.isEmpty() && requestInterceptsEnabled) { requestPackets(); } packetHandlers.put(connectPoint, registration); } }
public static <T> long computeCartesianSize(SetMultimap<T, ?> keyToEncountered) { if (keyToEncountered.isEmpty()) { return 0; } else { long size = 1; for (T key : keyToEncountered.keySet()) { size *= keyToEncountered.get(key).size(); } return size; } }
@Override public boolean isAdditive() { if (this.indexNameToAdditions != null && this.indexNameToAdditions.size() > 0) { if (this.indexNameToRemovals == null || this.indexNameToRemovals.isEmpty()) { return true; } } return false; }
public static <T> long computeCartesianSize(SetMultimap<T, ?> keyToEncountered) { if (keyToEncountered.isEmpty()) { return 0; } else { long size = 1; for (T key : keyToEncountered.keySet()) { size *= keyToEncountered.get(key).size(); } return size; } }
private <T extends AbstractRelation<?, ?>> boolean processRelationModifications(SetMultimap<ModificationType, T> modifiedRelations) { relationRepository.save(modifiedRelations.get(ModificationType.UPDATE)); relationRepository.delete(modifiedRelations.get(ModificationType.DELETE)); return !modifiedRelations.isEmpty(); }
public void unregisterCommand(BaseCommand command) { for (Map.Entry<String, RootCommand> entry : command.registeredCommands.entrySet()) { String jdaCommandName = entry.getKey().toLowerCase(); JDARootCommand jdaCommand = (JDARootCommand) entry.getValue(); jdaCommand.getSubCommands().values().removeAll(command.subCommands.values()); if (jdaCommand.isRegistered && jdaCommand.getSubCommands().isEmpty()) { jdaCommand.isRegistered = false; commands.remove(jdaCommandName); } } }
private void unregister(ConnectPoint connectPoint, HandlerRegistration registration) { synchronized (packetHandlers) { packetHandlers.remove(connectPoint, registration); if (packetHandlers.isEmpty()) { cancelPackets(); } } }
public void unregisterCommand(BaseCommand command) { for (Map.Entry<String, RootCommand> entry : command.registeredCommands.entrySet()) { String commandName = entry.getKey().toLowerCase(); BungeeRootCommand bungeeCommand = (BungeeRootCommand) entry.getValue(); bungeeCommand.getSubCommands().values().removeAll(command.subCommands.values()); if (bungeeCommand.getSubCommands().isEmpty() && bungeeCommand.isRegistered) { unregisterCommand(bungeeCommand); bungeeCommand.isRegistered = false; registeredCommands.remove(commandName); } } }