String (@Nullable PsiType type) { Set<Exact> instanceOfTypes = myInstanceOf; Exact exact = type == null ? null : ObjectUtils.tryCast(exact(type), Exact.class); if (exact != null) { instanceOfTypes = StreamEx.of(instanceOfTypes) .without(exact) .toSet(); } return EntryStream.of("instanceof ", instanceOfTypes, "not instanceof ", myNotInstanceOf) .removeValues(Set::isEmpty) .mapKeyValue((prefix, set) -> StreamEx.of(set).map(Exact::toShortString).sorted().joining(", ", prefix, "")) .joining("\n"); }