title: Spring cache, same key on different caches
body: <p>I'm trying out to have two caches to store two different items, User and Group, with the same id. I expect I should be getting different values since they are two different caches. But it is not. </p>
  
  <pre><code>@Bean
  public JedisConnectionFactory jedisConnectionFactory() {
      LOG.debug("redis host: {}, redis port: {}", redisHost, redisPort);
      JedisConnectionFactory factory = new JedisConnectionFactory();
      factory.setUseSsl(true);
      factory.setHostName(redisHost);
      factory.setPort(redisPort);
      factory.setUsePool(true);
      factory.setPassword(primaryKey);
      return factory;
  }
  
  /**
   *
   * @return
   */
  @Bean(name = "redisTemplate")
  public RedisTemplate redisTemplate() {
      RedisTemplate template = new RedisTemplate();
      template.setConnectionFactory(jedisConnectionFactory());
      return template;
  }
  
  /**
   *
   * @return
   */
  @Bean
  public CacheManager cacheManager() {
      RedisCacheManager manager = new RedisCacheManager(redisTemplate());
      manager.setCacheNames(Arrays.asList("users", "groups"));
      return manager;
  }
  
  @Cacheable(cacheNames = "users", key = "#id")
  public User findUserById(String id) {
      return null;
  }
  
  @Cacheable(cacheNames = "users", key = "#user.id")
  public User updateUser(User user) {
      return user;
  }
  
  @Cacheable(cacheNames = "groups", key = "#id")
  public Group findGroupById(String id) {
      return null;
  }
  
  @CachePut(cacheNames = "groups", key = "#group.id")
  public Group updateGroup(Group group) {
      return group;
  }
  </code></pre>
  
  <p>JUnit.</p>
  
  <pre><code>    service.removeCaches();
  
      User user = new User();
      user.setName("oldUser");
      user.setId("1");
  
  
      // USER
      assertNull(service.findUserById("1"));
  
      service.updateUser(user);
  
      User userCached = service.findUserById("1");
      LOG.debug(userCached);
      assertNotNull(userCached);
      assertEquals(userCached.getName(), "oldUser");
  
      // GROUP
      assertNull(service.findGroupById("1")); // &lt;== here, im actually getting user instead of null. cache has been cleared before the test starts. 
  </code></pre>
  
  <p>Maybe I misunderstand the concept of different caches here. Or maybe key should be unique even within different caches?</p>
  
  <p>Logs</p>
  
  <pre><code> Results :
  
  Tests in error: 
    testCache(TestRedisServiceImpl): User cannot be cast to Group
  </code></pre>
  
  <p>This basically indicates that a user is returned from the cache.</p>