package o; import java.util.Collections; import java.util.Comparator; /* loaded from: classes.dex */ public final class xNZ implements Comparator { private final Comparator b; static { new xNZ(new Comparator>() { // from class: o.xNZ.2 @Override // java.util.Comparator public final /* synthetic */ int compare(Comparable comparable, Comparable comparable2) { return comparable.compareTo(comparable2); } }); new xNZ(Collections.reverseOrder()); } public static > xNZ a(InterfaceC1244Ytw interfaceC1244Ytw) { return new xNZ<>(new Comparator(interfaceC1244Ytw) { // from class: o.xNZ.4 private InterfaceC1244Ytw a; { this.a = interfaceC1244Ytw; } @Override // java.util.Comparator public final int compare(T t, T t2) { return ((Comparable) this.a.d(t)).compareTo((Comparable) this.a.d(t2)); } }); } private xNZ(Comparator comparator) { this.b = comparator; } @Override // java.util.Comparator public final int compare(T t, T t2) { return this.b.compare(t, t2); } @Override // java.util.Comparator public final /* synthetic */ Comparator reversed() { return new xNZ(Collections.reverseOrder(this.b)); } @Override // java.util.Comparator public final /* synthetic */ Comparator thenComparing(Comparator comparator) { return new xNZ(new Comparator(this, comparator) { // from class: o.xNZ.5 private xNZ b; private Comparator d; { this.b = this; this.d = comparator; } @Override // java.util.Comparator public final int compare(T t, T t2) { int compare = this.b.b.compare(t, t2); return compare == 0 ? this.d.compare(t, t2) : compare; } }); } }