@Override public JsonSerialize.Inclusion findSerializationInclusion(Annotated a, JsonSerialize.Inclusion defValue) { /* This is bit trickier: need to combine results in a meaningful * way. Seems like it should be a disjoint; that is, most * restrictive value should be returned. * For enumerations, comparison is done by indexes, which * works: largest value is the last one, which is the most * restrictive value as well. */ JsonSerialize.Inclusion v1 = _primary.findSerializationInclusion(a, defValue); JsonSerialize.Inclusion v2 = _secondary.findSerializationInclusion(a, defValue); if (v1 == null) { return v2; } if (v2 == null) { return v1; } return (v1.compareTo(v2) < 0) ? v2 : v1; }