UserPropertiesMigrationImpl implements UserPropertiesMigration { @Override public boolean needsMigration(UserProperties properties, Class<?> target) { return !target.isAssignableFrom(properties.getClass()); }  @Autowired void setUserDao(UserDao userDao); @PreDestroy void stop(); @Override boolean needsMigration(UserProperties properties, Class<?> target); @SuppressWarnings("unchecked") @Override T migrate(UserProperties properties,
      Class<T> target); @Override void startUserPropertiesBulkMigration(
      Class<T> target); @Override UserPropertiesMigrationStatus getUserPropertiesBulkMigrationStatus();  }
@Test public void testNeedsMigration() { UserPropertiesV1 v1 = new UserPropertiesV1(); assertFalse(_service.needsMigration(v1, UserPropertiesV1.class)); assertTrue(_service.needsMigration(v1, UserPropertiesV2.class)); UserPropertiesV2 v2 = new UserPropertiesV2(); assertTrue(_service.needsMigration(v2, UserPropertiesV1.class)); assertFalse(_service.needsMigration(v2, UserPropertiesV2.class)); }