public static boolean isAssociativeOperation(PsiPolyadicExpression expression) {
    final IElementType tokenType = expression.getOperationTokenType();
    final PsiType type = expression.getType();
    final PsiPrimitiveType primitiveType;
    if (type instanceof PsiClassType) {
      primitiveType = PsiPrimitiveType.getUnboxedType(type);
      if (primitiveType == null) {
        return false;
      }
    }
    else if (type instanceof PsiPrimitiveType) {
      primitiveType = (PsiPrimitiveType)type;
    }
    else {
      return false;
    }

    if (JavaTokenType.PLUS == tokenType || JavaTokenType.ASTERISK == tokenType) {
      return !PsiTypes.floatType().equals(primitiveType) && !PsiTypes.doubleType().equals(primitiveType);
    }
    else if (JavaTokenType.EQEQ == tokenType || JavaTokenType.NE == tokenType) {
      return PsiTypes.booleanType().equals(primitiveType);
    }
    else if (JavaTokenType.AND == tokenType || JavaTokenType.OR == tokenType || JavaTokenType.XOR == tokenType) {
      return true;
    }
    else if (JavaTokenType.OROR == tokenType || JavaTokenType.ANDAND == tokenType) {
      return true;
    }
    return false;
  }
public static boolean isAssociativeOperation(PsiPolyadicExpression expression)