public List<InstanceConfig> findInstanceConfigsByNamespaceWithReleaseKeysNotIn(String appId,
                                                                                 String clusterName,
                                                                                 String
                                                                                     namespaceName,
                                                                                 Set<String>
                                                                                     releaseKeysNotIn) {
    List<InstanceConfig> instanceConfigs = instanceConfigRepository.
        findByConfigAppIdAndConfigClusterNameAndConfigNamespaceNameAndDataChangeLastModifiedTimeAfterAndReleaseKeyNotIn(appId, clusterName,
            namespaceName, getValidInstanceConfigDate(), releaseKeysNotIn);

    if (CollectionUtils.isEmpty(instanceConfigs)) {
      return Collections.emptyList();
    }

    return instanceConfigs;
  }
@Test
  @Rollback
  public void testFindInstanceConfigsByNamespaceWithReleaseKeysNotIn() throws Exception {
    long someInstanceId = 1;
    long anotherInstanceId = 2;
    long yetAnotherInstanceId = 3;
    String someConfigAppId = "someConfigAppId";
    String someConfigClusterName = "someConfigClusterName";
    String someConfigNamespaceName = "someConfigNamespaceName";
    Date someValidDate = new Date();
    String someReleaseKey = "someReleaseKey";
    String anotherReleaseKey = "anotherReleaseKey";
    String yetAnotherReleaseKey = "yetAnotherReleaseKey";

    InstanceConfig someInstanceConfig = prepareInstanceConfigForInstance(someInstanceId,
        someConfigAppId, someConfigClusterName,
        someConfigNamespaceName, someReleaseKey, someValidDate);
    InstanceConfig anotherInstanceConfig = prepareInstanceConfigForInstance(anotherInstanceId,
        someConfigAppId, someConfigClusterName,
        someConfigNamespaceName, someReleaseKey, someValidDate);
    prepareInstanceConfigForInstance(yetAnotherInstanceId, someConfigAppId, someConfigClusterName,
        someConfigNamespaceName, anotherReleaseKey, someValidDate);

    List<InstanceConfig> instanceConfigs = instanceService
        .findInstanceConfigsByNamespaceWithReleaseKeysNotIn(someConfigAppId,
            someConfigClusterName, someConfigNamespaceName, Sets.newHashSet(anotherReleaseKey,
                yetAnotherReleaseKey));

    assertEquals(Lists.newArrayList(someInstanceConfig, anotherInstanceConfig), instanceConfigs);
  }