public boolean areListedInterfacesValid(final MemberDeclaration delegate) {
boolean _xblockexpression = false;
{
TypeDeclaration _declaringType = delegate.getDeclaringType();
final TypeReference declaringType = this.context.newSelfTypeReference(_declaringType);
final Set<? extends TypeReference> interfacesOfDeclaringType = this.getImplementedInterfaces(declaringType);
TypeReference _type = this.getType(delegate);
final Set<? extends TypeReference> availableInterfaces = this.getImplementedInterfaces(_type);
final Set<TypeReference> listedInterfaces = this.listedInterfaces(delegate);
boolean valid = true;
for (final TypeReference iface : listedInterfaces) {
{
final Function1<TypeReference, Boolean> _function = new Function1<TypeReference, Boolean>() {
public Boolean apply(final TypeReference it) {
Type _type = it.getType();
Type _type_1 = iface.getType();
return Boolean.valueOf(Objects.equal(_type, _type_1));
}
};
boolean _exists = IterableExtensions.exists(availableInterfaces, _function);
boolean _not = (!_exists);
if (_not) {
StringConcatenation _builder = new StringConcatenation();
TypeReference _type_1 = this.getType(delegate);
String _simpleName = _type_1.getSimpleName();
_builder.append(_simpleName, "");
_builder.append(" does not implement ");
String _simpleName_1 = iface.getSimpleName();
_builder.append(_simpleName_1, "");
this.context.addError(delegate, _builder.toString());
valid = false;
}
final Function1<TypeReference, Boolean> _function_1 = new Function1<TypeReference, Boolean>() {
public Boolean apply(final TypeReference it) {
Type _type = it.getType();
Type _type_1 = iface.getType();
return Boolean.valueOf(Objects.equal(_type, _type_1));
}
};
boolean _exists_1 = IterableExtensions.exists(interfacesOfDeclaringType, _function_1);
boolean _not_1 = (!_exists_1);
if (_not_1) {
StringConcatenation _builder_1 = new StringConcatenation();
String _simpleName_2 = declaringType.getSimpleName();
_builder_1.append(_simpleName_2, "");
_builder_1.append(" does not implement ");
String _simpleName_3 = iface.getSimpleName();
_builder_1.append(_simpleName_3, "");
this.context.addError(delegate, _builder_1.toString());
valid = false;
}
}
}
boolean _and = false;
boolean _isEmpty = listedInterfaces.isEmpty();
if (!_isEmpty) {
_and = false;
} else {
Sets.SetView<? extends TypeReference> _intersection = Sets.intersection(interfacesOfDeclaringType, availableInterfaces);
boolean _isEmpty_1 = _intersection.isEmpty();
_and = _isEmpty_1;
}
if (_and) {
StringConcatenation _builder = new StringConcatenation();
TypeReference _type_1 = this.getType(delegate);
String _simpleName = _type_1.getSimpleName();
_builder.append(_simpleName, "");
_builder.append(" and ");
String _simpleName_1 = declaringType.getSimpleName();
_builder.append(_simpleName_1, "");
_builder.append(" have no interfaces in common");