code: private Object getOrMakeSerializedObject( Object entityEntryValue,
                                                     Map<Object, Map<String, Object>> serializedCache )
    {
      if( serializedCache.containsKey( entityEntryValue ) ) //cyclic relation
      {
        //take from cache and substitute
        return serializedCache.get( entityEntryValue );
      }
      else //not cyclic relation
      {
        //serialize and put into result
        return serializeToMap( entityEntryValue, serializedCache );
      }
    }
docs: Returns serialized object from cache or serializes object if it's not present in cache.
  
  @param entityEntryValue object to be serialized
  @return Map formed from given object