@Override public boolean equals(Object other) { return (this == other || (other instanceof MutablePropertyValues && this.propertyValueList.equals(((MutablePropertyValues) other).propertyValueList))); }
@Override public boolean equals(@Nullable Object other) { if (!(other instanceof Handshake)) return false; Handshake that = (Handshake) other; return tlsVersion.equals(that.tlsVersion) && cipherSuite.equals(that.cipherSuite) && peerCertificates.equals(that.peerCertificates) && localCertificates.equals(that.localCertificates); }
@Override public boolean equals(@Nullable Object o) { if (o instanceof MethodIdentifier) { MethodIdentifier ident = (MethodIdentifier) o; return name.equals(ident.name) && parameterTypes.equals(ident.parameterTypes); } return false; } }
@Override public boolean equals(@Nullable Object obj) { if (obj instanceof OrPredicate) { OrPredicate<?> that = (OrPredicate<?>) obj; return components.equals(that.components); } return false; }
@Override public boolean equals(Object obj) { if (obj instanceof TypeParameterSignature) { TypeParameterSignature other = (TypeParameterSignature) obj; /* * The name is here only for display purposes; <E extends Number> and <T * extends Number> are equivalent. */ return bounds.equals(other.bounds); } return false; }
@Override public boolean equals(@Nullable Object obj) { if (obj instanceof AndPredicate) { AndPredicate<?> that = (AndPredicate<?>) obj; return components.equals(that.components); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } synchronized (mutex) { return delegate().equals(o); } }
@Override public boolean equals(Object obj) { if (obj instanceof TypeSignature) { TypeSignature other = (TypeSignature) obj; return parameterSignatures.equals(other.parameterSignatures); } return false; }
@Override public List<MediaType> resolveMediaTypes(NativeWebRequest request) throws HttpMediaTypeNotAcceptableException { for (ContentNegotiationStrategy strategy : this.strategies) { List<MediaType> mediaTypes = strategy.resolveMediaTypes(request); if (mediaTypes.equals(MEDIA_TYPE_ALL_LIST)) { continue; } return mediaTypes; } return MEDIA_TYPE_ALL_LIST; }
boolean equalsNonHost(Address that) { return this.dns.equals(that.dns) && this.proxyAuthenticator.equals(that.proxyAuthenticator) && this.protocols.equals(that.protocols) && this.connectionSpecs.equals(that.connectionSpecs) && this.proxySelector.equals(that.proxySelector) && Objects.equals(this.proxy, that.proxy) && Objects.equals(this.sslSocketFactory, that.sslSocketFactory) && Objects.equals(this.hostnameVerifier, that.hostnameVerifier) && Objects.equals(this.certificatePinner, that.certificatePinner) && this.url().port() == that.url().port(); }
@Override public String toString() { return (bounds.equals(ImmutableList.of(Object.class))) ? name : name + " extends " + getTypesString(bounds); } }
@CollectionSize.Require(absent = CollectionSize.ZERO) public void testEquals_otherListContainingNull() { List<E> other = new ArrayList<>(getSampleElements()); other.set(other.size() / 2, null); assertFalse( "Two Lists should not be equal if exactly one of them has null at a given index.", getList().equals(other)); }
public void testEquals_otherListWithSameElements() { assertTrue( "A List should equal any other List containing the same elements.", getList().equals(new ArrayList<E>(getOrderedElements()))); }
@CollectionSize.Require(absent = CollectionSize.ZERO) @CollectionFeature.Require(ALLOWS_NULL_VALUES) public void testEquals_containingNull() { ArrayList<E> elements = new ArrayList<>(getSampleElements()); elements.set(elements.size() / 2, null); collection = getSubjectGenerator().create(elements.toArray()); List<E> other = new ArrayList<>(getSampleElements()); assertFalse( "Two Lists should not be equal if exactly one of them has null at a given index.", getList().equals(other)); }
public void testEquals_longerList() { Collection<E> moreElements = getSampleElements(getNumElements() + 1); assertFalse( "Lists of different sizes should not be equal.", getList().equals(new ArrayList<E>(moreElements))); }
@Override public boolean equals(Object obj) { if (obj instanceof MethodSignature) { MethodSignature other = (MethodSignature) obj; return name.equals(other.name) && parameterTypes.equals(other.parameterTypes) && typeSignature.equals(other.typeSignature); } return false; }
@CollectionSize.Require(absent = CollectionSize.ZERO) public void testEquals_otherListWithDifferentElements() { ArrayList<E> other = new ArrayList<>(getSampleElements()); other.set(other.size() / 2, getSubjectGenerator().samples().e3()); assertFalse( "A List should not equal another List containing different elements.", getList().equals(other)); }
@CollectionSize.Require(absent = CollectionSize.ZERO) public void testEquals_shorterList() { Collection<E> fewerElements = getSampleElements(getNumElements() - 1); assertFalse( "Lists of different sizes should not be equal.", getList().equals(new ArrayList<E>(fewerElements))); }
public void testAsListEquals() { assertEquals(Booleans.asList(EMPTY), Collections.emptyList()); assertEquals(Booleans.asList(ARRAY_FALSE), Booleans.asList(ARRAY_FALSE)); assertFalse(Booleans.asList(ARRAY_FALSE).equals(ARRAY_FALSE)); assertFalse(Booleans.asList(ARRAY_FALSE).equals(null)); assertFalse(Booleans.asList(ARRAY_FALSE).equals(Booleans.asList(ARRAY_FALSE_TRUE))); assertFalse(Booleans.asList(ARRAY_FALSE_FALSE).equals(Booleans.asList(ARRAY_FALSE_TRUE))); assertEquals(1, Booleans.asList(ARRAY_FALSE_TRUE).lastIndexOf(true)); List<Boolean> reference = Booleans.asList(ARRAY_FALSE); assertEquals(Booleans.asList(ARRAY_FALSE), reference); assertEquals(reference, reference); }
@Test public void varyBy() { Mono<ServerResponse> result = ServerResponse.ok().varyBy("foo").build(); List<String> expected = Collections.singletonList("foo"); StepVerifier.create(result) .expectNextMatches(response -> expected.equals(response.headers().getVary())) .expectComplete() .verify(); }