public List<Instance> findInstancesByIds(Set<Long> instanceIds) {
    Iterable<Instance> instances = instanceRepository.findAllById(instanceIds);
    return Lists.newArrayList(instances);
  }
@Test
  @Rollback
  public void testFindInstancesByIds() throws Exception {
    String someAppId = "someAppId";
    String someClusterName = "someClusterName";
    String someDataCenter = "someDataCenter";
    String someIp = "someIp";
    String anotherIp = "anotherIp";

    Instance someInstance = instanceService.createInstance(assembleInstance(someAppId,
        someClusterName, someDataCenter, someIp));
    Instance anotherInstance = instanceService.createInstance(assembleInstance(someAppId,
        someClusterName, someDataCenter, anotherIp));

    List<Instance> instances = instanceService.findInstancesByIds(Sets.newHashSet(someInstance
        .getId(), anotherInstance.getId()));

    Set<String> ips = instances.stream().map(Instance::getIp).collect(Collectors.toSet());
    assertEquals(2, instances.size());
    assertEquals(Sets.newHashSet(someIp, anotherIp), ips);
  }