code: public static String _iriCompactionStep5point4(String iri, Object value, String compactIRI,
              final String candidate, Map<String, Object> termDefinitions) {
  
          final boolean condition1 = (compactIRI == null
                  || compareShortestLeast(candidate, compactIRI) < 0);
  
          final boolean condition2 = (!termDefinitions.containsKey(candidate) || (iri
                  .equals(((Map<String, Object>) termDefinitions.get(candidate)).get(JsonLdConsts.ID))
                  && value == null));
  
          if (condition1 && condition2) {
              compactIRI = candidate;
          }
          return compactIRI;
      }
docs: /*
  This method is only visible for testing.