KieBuilder kieBuilder = ks.newKieBuilder( kfs ).buildAll();
assertEquals( 1, kieBuilder.getResults().getMessages( org.kie.api.builder.Message.Level.ERROR ).size() );
//Add file with error - expect 1 "added" error message
kfs.write( "src/main/resources/r2.drl", drl2_1 );
IncrementalResults addResults = ( (InternalKieBuilder) kieBuilder ).createFileSet( "src/main/resources/r2.drl" ).build();
assertEquals( 1, addResults.getAddedMessages().size() );
assertEquals( 0, addResults.getRemovedMessages().size() );
//Update flawed file with correct version - expect 0 "added" error messages and removal of 1 previous error relating to updated file
kfs.write( "src/main/resources/r2.drl", drl2_2 );
IncrementalResults removeResults = ( (InternalKieBuilder) kieBuilder ).createFileSet( "src/main/resources/r2.drl" ).build();
assertEquals( 0, removeResults.getAddedMessages().size() );
assertEquals( 1, removeResults.getRemovedMessages().size() );
}