code: public static Set<String> getSpecifiedRealms(Root root) {
          Set<String> result = new HashSet<String>();
          List<Context> contexts = root.getContexts();
          for (Context context : contexts) {
              String key = context.getKey();
              if (key != null && key.equals(SchemaConstants.PROP_REALM)) {
                  String value = (String) context.getValue();
                  result.add(value);
              }
          }
          return result;
      }
docs: return the specified realms from the root object of the input data graph
  
  @param root
  @return