YumPackageName { public boolean isSubsetOf(YumPackageName other) { return Objects.equals(name, other.name) && (epoch.isEmpty() || Objects.equals(epoch, other.epoch)) && (version.isEmpty() || Objects.equals(version, other.version)) && (release.isEmpty() || Objects.equals(release, other.release)) && (architecture.isEmpty() || Objects.equals(architecture, other.architecture)); } private  YumPackageName(Optional<String> epoch,
                           String name,
                           Optional<String> version,
                           Optional<String> release,
                           Optional<String> architecture); static YumPackageName fromString(final String packageSpec); static Optional<YumPackageName> parseString(final String packageSpec); Optional<String> getEpoch(); String getName(); Optional<String> getVersion(); Optional<String> getRelease(); Optional<String> getArchitecture(); String toName(); String toVersionLockName(); boolean isSubsetOf(YumPackageName other); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testSubset() { YumPackageName yumPackage = new YumPackageName.Builder("docker") .setVersion("1.12.6") .build(); assertTrue(yumPackage.isSubsetOf(yumPackage)); assertTrue(yumPackage.isSubsetOf(new YumPackageName.Builder("docker") .setVersion("1.12.6") .setEpoch("2") .setRelease("71.git3e8e77d.el7.centos.1") .setArchitecture("x86_64") .build())); assertFalse(yumPackage.isSubsetOf(new YumPackageName.Builder("docker") .setVersion("1.13.1") .build())); }