MediaPackageElementFlavor implements Cloneable, Comparable<MediaPackageElementFlavor>, Serializable { @Override public boolean equals(Object other) { return (other instanceof MediaPackageElementFlavor) && type.equals(((MediaPackageElementFlavor) other).type) && subtype.equals(((MediaPackageElementFlavor) other).subtype); } private  MediaPackageElementFlavor();  MediaPackageElementFlavor(String type, String subtype); static MediaPackageElementFlavor flavor(String type, String subtype); String getType(); String getSubtype(); MediaPackageElementFlavor applyTo(MediaPackageElementFlavor target); @Override MediaPackageElementFlavor clone(); boolean eq(String flavor); @Override int compareTo(MediaPackageElementFlavor m); @Override String toString(); static MediaPackageElementFlavor parseFlavor(String s); boolean matches(MediaPackageElementFlavor other); @Override int hashCode(); @Override boolean equals(Object other); static final String WILDCARD; static final String SEPARATOR; static final Function<String, MediaPackageElementFlavor> parseFlavor; }
@Test public void testEquals() { assertEquals("Leading or trailing whitespace in the flavor type should be trimmed", flavor(" \r \n \t type \t \n \r ", "subtype"), flavor("type", "subtype")); assertEquals("Leading or trailing whitespace in the flavor subtype should be ignored", flavor("type", " \r \n \t subtype \t \n \r "), flavor("type", "subtype")); assertEquals("Leading or trailing whitespace in both the flavor type and subtype should be trimmed", flavor(" \r \n \t type \t \n \r ", " \r \n \t subtype \t \n \r "), flavor("type", "subtype")); assertEquals("Flavor type should be case-insensitive", flavor("TYPE", "subtype"), flavor("type", "subtype")); assertEquals("Flavor type should be case-insensitive", flavor("type", "SUBTYPE"), flavor("type", "subtype")); assertEquals("Flavor parts should be case-insensitive", flavor("TYPE", "SUBTYPE"), flavor("type", "subtype")); }