List of usage examples for java.util Collections EMPTY_SET
Set EMPTY_SET
To view the source code for java.util Collections EMPTY_SET.
Click Source Link
From source file:com.adobe.ags.curly.test.ErrorBehaviorTest.java
@Test public void testActionRequireFailure() throws IOException, ParseException { ApplicationState.getInstance().errorBehaviorProperty().set(ErrorBehavior.HALT); Action fail1 = failureAction(); Action fail2 = failureAction(); fail1.setErrorBehavior(ErrorBehavior.SKIP_IF_SUCCESSFUL); fail2.setErrorBehavior(ErrorBehavior.SKIP_IF_SUCCESSFUL); List<Action> actions = Arrays.asList(fail1, fail2); ActionGroupRunner runner = new ActionGroupRunner("Action Require Failure Test", ignore -> client, actions, Collections.EMPTY_MAP, Collections.EMPTY_SET); runner.run();/*from w w w . ja va2s .co m*/ assertResults(runner.getResult(), false, true); }
From source file:de.javakaffee.kryoserializers.KryoTest.java
@BeforeTest protected void beforeTest() { _kryo = new KryoReflectionFactorySupport() { @Override// w w w . j a v a2 s . c o m @SuppressWarnings({ "rawtypes", "unchecked" }) public Serializer<?> getDefaultSerializer(final Class type) { if (EnumSet.class.isAssignableFrom(type)) { return new EnumSetSerializer(); } if (EnumMap.class.isAssignableFrom(type)) { return new EnumMapSerializer(); } if (Collection.class.isAssignableFrom(type)) { return new CopyForIterateCollectionSerializer(); } if (Map.class.isAssignableFrom(type)) { return new CopyForIterateMapSerializer(); } if (Date.class.isAssignableFrom(type)) { return new DateSerializer(type); } return super.getDefaultSerializer(type); } }; _kryo.setRegistrationRequired(false); _kryo.register(Arrays.asList("").getClass(), new ArraysAsListSerializer()); _kryo.register(Collections.EMPTY_LIST.getClass(), new CollectionsEmptyListSerializer()); _kryo.register(Collections.EMPTY_MAP.getClass(), new CollectionsEmptyMapSerializer()); _kryo.register(Collections.EMPTY_SET.getClass(), new CollectionsEmptySetSerializer()); _kryo.register(Collections.singletonList("").getClass(), new CollectionsSingletonListSerializer()); _kryo.register(Collections.singleton("").getClass(), new CollectionsSingletonSetSerializer()); _kryo.register(Collections.singletonMap("", "").getClass(), new CollectionsSingletonMapSerializer()); _kryo.register(BigDecimal.class, new BigDecimalSerializer()); _kryo.register(BigInteger.class, new BigIntegerSerializer()); _kryo.register(Pattern.class, new RegexSerializer()); _kryo.register(BitSet.class, new BitSetSerializer()); _kryo.register(URI.class, new URISerializer()); _kryo.register(UUID.class, new UUIDSerializer()); _kryo.register(GregorianCalendar.class, new GregorianCalendarSerializer()); _kryo.register(InvocationHandler.class, new JdkProxySerializer()); UnmodifiableCollectionsSerializer.registerSerializers(_kryo); SynchronizedCollectionsSerializer.registerSerializers(_kryo); }
From source file:bpelg.packaging.ode.util.BgSchemaCollection.java
public Collection getSchemas() { if (schemas != null) { return schemas.values(); } else {//from www.j a v a 2 s. c om return java.util.Collections.EMPTY_SET; } }
From source file:org.apache.marmotta.kiwi.sparql.builder.eval.ValueExpressionEvaluator.java
@Override public void meet(Exists node) throws RuntimeException { // TODO: need to make sure that variables of the parent are visible in the subquery // - pattern names need to be unique even in subqueries // - variable lookup for expressions in the subquery need to refer to the parent SQLBuilder sq_builder = new SQLBuilder(node.getSubQuery(), parent.getBindings(), parent.getDataset(), parent.getConverter(), parent.getDialect(), "_", Collections.EMPTY_SET, copyVariables(parent.getVariables())); builder.append("EXISTS (").append(sq_builder.build()).append(")"); }
From source file:org.beanfuse.security.menu.service.MenuAuthorityServiceImpl.java
/** * module????//from w ww . j ava 2 s . c o m * * @param modules * @return */ public static Set distillResources(Collection menus) { if (null == menus || menus.size() < 0) return Collections.EMPTY_SET; Set actionNames = new HashSet(); for (Iterator it = menus.iterator(); it.hasNext();) { Set actions = ((Menu) it.next()).getResources(); if (null != actions) { for (Iterator ot = actions.iterator(); ot.hasNext();) { actionNames.add(((Resource) ot.next()).getName()); } } } return actionNames; }
From source file:pt.ist.maidSyncher.domain.activeCollab.ACTask.java
private Collection<String> processMilestone(pt.ist.maidSyncher.api.activeCollab.ACTask acTask) { ACMilestone newMilestone = ACMilestone.findById(acTask.getMilestoneId()); ACMilestone oldMilestone = getMilestone(); setMilestone(newMilestone);//w w w .ja v a 2s . c om return !ObjectUtils.equals(oldMilestone, newMilestone) ? Collections.singleton(getPropertyDescriptorNameAndCheckItExists(acTask, "milestoneId")) : Collections.EMPTY_SET; }
From source file:org.jsecurity.cache.ehcache.EhCache.java
public Set values() { try {/*ww w.j ava 2s .c o m*/ List keys = cache.getKeys(); if (keys != null && !keys.isEmpty()) { Set values = new LinkedHashSet(keys.size()); for (Object key : keys) { values.add(cache.get(key)); } return Collections.unmodifiableSet(values); } else { return Collections.EMPTY_SET; } } catch (Throwable t) { throw new CacheException(t); } }
From source file:org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.LinuxTestCase.java
/** * This method will return a set of attributes and their corresponding * expected intervals that will be tested with the actual intervals obtained * from the state system. It does not have to return all attributes of a * given state system, only the ones interesting for this test case. * * @return A set of {@link IntervalInfo} objects to verify *///w w w .j a v a 2 s. com public Set<IntervalInfo> getTestIntervals() { return Collections.EMPTY_SET; }
From source file:org.apache.camel.impl.DefaultPackageScanClassResolver.java
@SuppressWarnings("unchecked") public Set<Class<?>> findAnnotated(Set<Class<? extends Annotation>> annotations, String... packageNames) { if (packageNames == null) { return Collections.EMPTY_SET; }//ww w .ja v a 2 s .c o m if (log.isDebugEnabled()) { log.debug( "Searching for annotations of " + annotations + " in packages: " + Arrays.asList(packageNames)); } PackageScanFilter test = getCompositeFilter(new AnnotatedWithAnyPackageScanFilter(annotations, true)); Set<Class<?>> classes = new LinkedHashSet<Class<?>>(); for (String pkg : packageNames) { find(test, pkg, classes); } if (log.isDebugEnabled()) { log.debug("Found: " + classes); } return classes; }
From source file:org.cloudfoundry.identity.uaa.scim.bootstrap.ScimGroupBootstrap.java
public void setNonDefaultUserGroups(Set<String> nonDefaultUserGroups) { if (nonDefaultUserGroups == null) { nonDefaultUserGroups = Collections.EMPTY_SET; }/* w ww. j av a 2s. c o m*/ this.nonDefaultUserGroups = nonDefaultUserGroups.stream().collect(collector); setCombinedGroups(); }