@VisibleForTesting protected void updateIsLatest(List<Vocabulary> vocabularies,List<Vocabulary> registered){
  if (!vocabularies.isEmpty() && !registered.isEmpty()) {
    for (    Vocabulary vocabulary : vocabularies) {
      for (      Vocabulary rVocabulary : registered) {
        if (vocabulary.getUriString() != null && rVocabulary.getUriString() != null) {
          String idOne=vocabulary.getUriString();
          String idTwo=rVocabulary.getUriString();
          if (idOne.equalsIgnoreCase(idTwo)) {
            Date issuedOne=vocabulary.getIssued();
            Date issuedTwo=rVocabulary.getIssued();
            if ((issuedOne == null && issuedTwo == null) || (issuedOne != null && issuedTwo != null && issuedOne.compareTo(issuedTwo) == 0)) {
              vocabulary.setLatest(rVocabulary.isLatest());
            }
          }
        }
      }
      log.debug("Installed vocabulary with identifier " + vocabulary.getUriString() + " latest="+ vocabulary.isLatest());
    }
  }
}

@ VisibleForTesting protected void updateIsLatest ( List < Vocabulary > vocabularies , List < Vocabulary > registered ) { if ( ! vocabularies . isEmpty ( ) && ! registered . isEmpty ( ) ) { for ( Vocabulary vocabulary : vocabularies ) { for ( Vocabulary rVocabulary : registered ) { if ( vocabulary . getUriString ( ) != null && rVocabulary . getUriString ( ) != null ) { String idOne = vocabulary . getUriString ( ) ; String idTwo = rVocabulary . getUriString ( ) ; if ( idOne . equalsIgnoreCase ( idTwo ) ) { Date issuedOne = vocabulary . getIssued ( ) ; Date issuedTwo = rVocabulary . getIssued ( ) ; if ( ( issuedOne == null && issuedTwo == null ) || ( issuedOne != null && issuedTwo != null && issuedOne . compareTo ( issuedTwo ) == 0 ) ) { vocabulary . setLatest ( rVocabulary . isLatest ( ) ) ; } } } } log . debug ( "Installed vocabulary with identifier " + vocabulary . getUriString ( ) + " latest=" + vocabulary . isLatest ( ) ) ; } } }
iterate through list of installed vocabularies . update each one , indicating if it is the latest version or not .
