/** * Returns a view on this iterable that contains all the elements except the first. * * @param iterable * the iterable. May not be <code>null</code>. * @return an iterable with all elements except the first. Never <code>null</code>. * @see #drop(Iterable, int) */ public static <T> Iterable<T> tail(final Iterable<T> iterable) { return drop(iterable, 1); }
/** * Returns a view on this iterable that contains all the elements except the first. * * @param iterable * the iterable. May not be <code>null</code>. * @return an iterable with all elements except the first. Never <code>null</code>. * @see #drop(Iterable, int) */ public static <T> Iterable<T> tail(final Iterable<T> iterable) { return drop(iterable, 1); }
private Iterable<EDataTypeInSlotsKey> minimizeEDataTypeList(final Iterable<EDataTypeInSlotsKey> types) { final Function1<EDataTypeInSlotsKey, EDataType> _function = (EDataTypeInSlotsKey it) -> { return it.getEmfKey(); }; final Function1<EDataType, Boolean> _function_1 = (EDataType it) -> { boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(it.getInstanceClassName()); return Boolean.valueOf((!_isNullOrEmpty)); }; final HashSet<EDataType> emfTypes = CollectionLiterals.<EDataType>newHashSet(((EDataType[])Conversions.unwrapArray(IterableExtensions.<EDataType>filter(IterableExtensions.<EDataTypeInSlotsKey, EDataType>map(types, _function), _function_1), EDataType.class))); Object _clone = emfTypes.clone(); final HashSet<EDataType> result = ((HashSet<EDataType>) _clone); final Iterator<EDataType> it = emfTypes.iterator(); while (it.hasNext()) { { final EDataType dataType = it.next(); final Function1<EDataType, Boolean> _function_2 = (EDataType it_1) -> { String _instanceClassName = it_1.getInstanceClassName(); String _instanceClassName_1 = dataType.getInstanceClassName(); return Boolean.valueOf(Objects.equal(_instanceClassName, _instanceClassName_1)); }; CollectionExtensions.<EDataType>removeAll(result, IterableExtensions.<EDataType>drop(IterableExtensions.<EDataType>filter(emfTypes, _function_2), 1)); } } final Function1<EDataType, EDataTypeInSlotsKey> _function_2 = (EDataType it_1) -> { return new EDataTypeInSlotsKey(it_1); }; return IterableExtensions.<EDataType, EDataTypeInSlotsKey>map(result, _function_2); }
/** * Get the template variable of the interaction that is the corresponding parameter for this step content, * given that the step content is part of a fixture call (interaction). * * e.g. useful in combination with {@link SimpleTypeComputer#getVariablesWithTypes} */ public TemplateVariable getTemplateParameterForCallingStepContent(final StepContent stepContent) { final TestStep testStep = EcoreUtil2.<TestStep>getContainerOfType(stepContent, TestStep.class); final int callParameterIndex = this._collectionUtils.<StepContent>indexOfFirst(this.getStepContentVariables(testStep), stepContent); final TemplateContainer templateContainer = this.getTemplateContainer(testStep); Template _template = null; if (templateContainer!=null) { _template=templateContainer.getTemplate(); } EList<TemplateContent> _contents = null; if (_template!=null) { _contents=_template.getContents(); } Iterable<TemplateVariable> _filter = null; if (_contents!=null) { _filter=Iterables.<TemplateVariable>filter(_contents, TemplateVariable.class); } final Iterable<TemplateVariable> templateParameters = _filter; if ((((templateContainer != null) && (templateParameters != null)) && (((Object[])Conversions.unwrapArray(templateParameters, Object.class)).length > callParameterIndex))) { return IterableExtensions.<TemplateVariable>head(IterableExtensions.<TemplateVariable>drop(templateParameters, callParameterIndex)); } return null; }