code: @Override
      public String getPrimaryType() {
          return resource instanceof JcrResource
                  ? ((JcrResource) resource).getPrimaryType()
                  : getProperty(JcrConstants.JCR_PRIMARYTYPE);
      }
docs: retrieves the primary type of the resources node; is using the 'getPrimaryType()' method
  if the wrapped resource is a JcrResource.