GradleCoordinate { public boolean isSameArtifact(@NonNull GradleCoordinate o) { return o.mGroupId.equals(mGroupId) && o.mArtifactId.equals(mArtifactId); } GradleCoordinate(@NonNull String groupId, @NonNull String artifactId,
            @NonNull RevisionComponent... revisions);  GradleCoordinate(@NonNull String groupId, @NonNull String artifactId,
            @NonNull String revision);  GradleCoordinate(@NonNull String groupId, @NonNull String artifactId,
            @NonNull int... revisions);  GradleCoordinate(@NonNull String groupId, @NonNull String artifactId,
            @NonNull List<RevisionComponent> revisions, @Nullable ArtifactType type); @Nullable static GradleCoordinate parseCoordinateString(@NonNull String coordinateString); static GradleCoordinate parseVersionOnly(@NonNull String revision); @NonNull static List<RevisionComponent> parseRevisionNumber(@NonNull String revision); @Override String toString(); @Nullable String getGroupId(); @Nullable String getArtifactId(); @Nullable ArtifactType getArtifactType(); @Nullable String getId(); @Nullable ArtifactType getType(); boolean acceptsGreaterRevisions(); @NonNull String getRevision(); boolean isPreview(); int getMajorVersion(); int getMinorVersion(); int getMicroVersion(); boolean isSameArtifact(@NonNull GradleCoordinate o); boolean matches(@NonNull GradleCoordinate pattern); @Override boolean equals(@NonNull Object o); @Override int hashCode(); static final String PREVIEW_ID; static final PlusComponent PLUS_REV; static final int PLUS_REV_VALUE; static final Comparator<GradleCoordinate> COMPARE_PLUS_LOWER; static final Comparator<GradleCoordinate> COMPARE_PLUS_HIGHER; }
@Test public void testIsSameArtifact() throws Exception { GradleCoordinate a = new GradleCoordinate("a.b.c", "package", 5, 4, 2); GradleCoordinate b = new GradleCoordinate("a.b.c", "package", 5, 5, 5); assertTrue(a.isSameArtifact(b)); assertTrue(b.isSameArtifact(a)); a = new GradleCoordinate("a.b", "package", 5, 4, 2); b = new GradleCoordinate("a.b.c", "package", 5, 5, 5); assertFalse(a.isSameArtifact(b)); assertFalse(b.isSameArtifact(a)); a = new GradleCoordinate("a.b.c", "package", 5, 4, 2); b = new GradleCoordinate("a.b.c", "feature", 5, 5, 5); assertFalse(a.isSameArtifact(b)); assertFalse(b.isSameArtifact(a)); }