code: private boolean isBeingDereferenced(final DetailAST pLiteralNew)
      {
          boolean result = false;
  
          final DetailAST parent = pLiteralNew.getParent();
          if (parent.getType() == TokenTypes.DOT && (pLiteralNew.getNextSibling() != null
              || parent.getParent().getType() == TokenTypes.DOT)) {
              result = true;
          }
          return result;
      }
docs: Determine if the instance created with <code>new</code> ist followed by a dot. If so, it is being used for
  something, so its existence is not considered useless.
  
  @param pLiteralNew the current LITERAL_NEW token found by the visitor
  @return <code>true</code> if the instance is being dereferenced