public void testOnlineLOF() throws UnableToComplyException {
UpdatableDatabase db = getDatabase();
// 1. Run LOF
LOF<DoubleVector, DoubleDistance> lof = new LOF<DoubleVector, DoubleDistance>(k, neighborhoodDistanceFunction, reachabilityDistanceFunction);
OutlierResult result1 = lof.run(db);
// 2. Run OnlineLOF (with insertions and removals) on database
OutlierResult result2 = runOnlineLOF(db);
// 3. Compare results
Relation<Double> scores1 = result1.getScores();
Relation<Double> scores2 = result2.getScores();
for(DBID id : scores1.getDBIDs()) {
Double lof1 = scores1.get(id);
Double lof2 = scores2.get(id);
assertTrue("lof(" + id + ") != lof(" + id + "): " + lof1 + " != " + lof2, lof1.equals(lof2));