private static PsiField @NotNull [] filterProperties(PsiField[] fields) {
    if (fields.length == 0) return PsiField.EMPTY_ARRAY;

    final List<String> fieldNamesList = mapNotNull(fields, it -> hasExplicitVisibilityModifiers(it) ? it.getName() : null);
    if (fieldNamesList.isEmpty()) return fields;

    final Set<String> fieldNames = new HashSet<>(fieldNamesList);
    return filter(fields, it -> hasExplicitVisibilityModifiers(it) || !fieldNames.remove(it.getName())).toArray(PsiField.EMPTY_ARRAY);
  }
private static PsiField @NotNull [] filterProperties(PsiField[] fields)