Build a sync constraint.

@param t    the current tree
@param args must be 1 set of vms. The set must not be empty
@return a constraint
502270
@Override
    public List<Sync> buildConstraint(BtrPlaceTree t, List<BtrpOperand> args) {
        if (!checkConformance(t, args)) {
            return Collections.emptyList();
        }

        @SuppressWarnings("unchecked")
        List<VM> s = (List<VM>) params[0].transform(this, t, args.get(0));
        if (s == null) {
            return Collections.emptyList();
        }

        if (s.size() < 2) {
            t.ignoreError("Parameter '" + params[0].getName() + "' expects a list of at least 2 VMs");
            return Collections.emptyList();
        }
        return Collections.singletonList(new Sync(s));
    }
942042
public Object createNewInstance(Class type, Object arg)
    {
        if (type != null)
            return createNewInstance(new Class[]{type}, new Object[]{arg});
        else
            return createNewInstance((Class[]) null, (Object[]) null);
    }
1303018
public static synchronized <T> T createStrictMockAndExpectNew(Class<T> type, Object... arguments) throws Exception {
        T mock = createStrictMock(type);
        expectStrictNew(type, arguments).andReturn(mock);
        return mock;
    }
686170
@SuppressWarnings("unchecked")
	public static <T> void fill(Collection<T> collection,T...args)
	{
		if(collection == null || args == null)
			return;
		
		for (T t : args)
		{
			collection.add(t);
		}
	}
473326
protected void checkConstraint(final Optional<Graph> graph, final IRI type, final RDFSyntax syntax) {
        graph.ifPresent(g -> {
            final List<ConstraintViolation> violations = constraintServices.stream().parallel()
                .flatMap(svc -> svc.constrainedBy(type, g)).collect(toList());
            if (!violations.isEmpty()) {
                final ResponseBuilder err = status(CONFLICT);
                violations.forEach(v -> err.link(v.getConstraint().getIRIString(), LDP.constrainedBy.getIRIString()));
                final StreamingOutput stream = new StreamingOutput() {
                    @Override
                    public void write(final OutputStream out) throws IOException {
                        getServices().getIOService().write(violations.stream().flatMap(v2 -> v2.getTriples().stream()),
                                out, syntax);
                    }
                };
                throw new ClientErrorException(err.entity(stream).build());
            }
        });
    }
772737
public <T, A> Function<A, T> getConstructor(Class<? extends T> clazz, Class<A> arg) {
        return getConstructorAs(Function.class, "apply", clazz, arg);
    }
44353
public static void requireArgValid(@NotNull final String name, @NotNull final String value) throws ConstraintViolationException {
        // CHECKSTYLE:ON

        if (!isValid(value)) {
            throw new ConstraintViolationException(
                    "The argument '" + name + "' does not represent a valid hour range like '09:00-12:00+13:00-17:00': '" + value + "'");
        }

    }
743750
public UniqueConstraint build(String name, boolean isPK) {
			ImmutableList<Attribute> attributes = builder.build();
			if (attributes.isEmpty())
				return null;
			return new UniqueConstraint(name, isPK, builder.build());
		}
24844
public Constraint<SVar<T>,Set<T>> rewrite(UnionFind<SVar<T>> uf) {
	SVar<T> vIn_p   = uf.find(vIn);
	SVar<T> vDest_p = uf.find(vDest);	
	return new CtDiffConstraint<T>(vIn_p, ctSet, vDest_p);
    }
977844
@Override
    public List<SatConstraint> buildConstraint(BtrPlaceTree t, List<BtrpOperand> args) {
        if (checkConformance(t, args)) {
            @SuppressWarnings("unchecked")
            List<VM> s = (List<VM>) params[0].transform(this, t, args.get(0));
            if (s == null) {
                return Collections.emptyList();
            }
            return s.stream().map(Ready::new).collect(Collectors.toList());
        }
        return Collections.emptyList();
    }
567826
private Sync<K, T, F> getSynchronizer(K key) {

        if (closed) {
            throw new IllegalStateException("ConnectionProvider is already closed");
        }

        Sync<K, T, F> sync = connections.get(key);

        if (sync != null) {
            return sync;
        }

        AtomicBoolean atomicBoolean = new AtomicBoolean();

        sync = connections.computeIfAbsent(key, connectionKey -> {

            Sync<K, T, F> createdSync = new Sync<>(key, connectionFactory.apply(key));

            if (closed) {
                createdSync.cancel();
            }

            return createdSync;
        });

        if (atomicBoolean.compareAndSet(false, true)) {

            sync.getConnection().whenComplete((c, t) -> {

                if (t != null) {
                    connections.remove(key);
                }
            });
        }

        return sync;
    }
67524
public static synchronized <T> T createStrictMock(Class<T> type, Method... methods) {
        return doMock(type, false, new StrictMockStrategy(), null, methods);
    }
54502
@Override
    protected final T create(Object... args) {
        final K key = this.getKey(args);
        final T value = this.createInternal(key, args);
        this.objectCache.put(key, value);
        return value;
    }
1144571
public static void requireArgValid(@NotNull final String name, @FileExists @NotNull final File value)
            throws ConstraintViolationException {
        // CHECKSTYLE:ON
        if (!value.isDirectory()) {
            throw new ConstraintViolationException("The argument '" + name + "' is not a directory: '" + value + "'");
        }
    }
1369754
public R run(A... arg) throws E
   {
      final TransactionManager tm = getTransactionManager();
      Transaction tx = null;
      try
      {
         if (tm != null)
         {
            try
            {
               tx = tm.suspend();
            }
            catch (SystemException e)
            {
               LOG.warn("Cannot suspend the current transaction", e);
            }
         }
         return execute(arg);
      }
      finally
      {
         if (tx != null)
         {
            try
            {
               tm.resume(tx);
            }
            catch (Exception e)
            {
               LOG.warn("Cannot resume the current transaction", e);
            }
         }
      }      
   }
719488
public org.tensorflow.framework.KernelDef.AttrConstraintOrBuilder getConstraintOrBuilder(
      int index) {
    return constraint_.get(index);
  }
186113
public SyncStatement request( Collection<? extends BEvent> toRequest ) {
        return new SyncStatement(getBthread(), toRequest, getWaitFor(), getBlock(), getInterrupt(), isHot(), getData());
    }