Program: 53196
Project: 53196
Buggy source:
@Test public void testThatInputChangesCauseRuleKeyChanges(){
  SourcePathResolver pathResolver=new SourcePathResolver(new BuildRuleResolver());
  BuildTarget target=BuildTargetFactory.newInstance("String_Node_Str");
  BuildRuleParams params=BuildRuleParamsFactory.createTrivialBuildRuleParams(target);
  RuleKeyBuilderFactory ruleKeyBuilderFactory=new DefaultRuleKeyBuilderFactory(FakeFileHashCache.createFromStrings(ImmutableMap.of("String_Node_Str",Strings.repeat("String_Node_Str",40),"String_Node_Str",Strings.repeat("String_Node_Str",40),"String_Node_Str",Strings.repeat("String_Node_Str",40))),pathResolver);
  RuleKey defaultRuleKey=generateRuleKey(ruleKeyBuilderFactory,new Lex(params,pathResolver,DEFAULT_LEX,DEFAULT_FLAGS,DEFAULT_OUTPUT_SOURCE,DEFAULT_OUTPUT_HEADER,DEFAULT_INPUT));
  RuleKey lexChange=generateRuleKey(ruleKeyBuilderFactory,new Lex(params,pathResolver,new HashedFileTool(Paths.get("String_Node_Str")),DEFAULT_FLAGS,DEFAULT_OUTPUT_SOURCE,DEFAULT_OUTPUT_HEADER,DEFAULT_INPUT));
  assertNotEquals(defaultRuleKey,lexChange);
  RuleKey flagsChange=generateRuleKey(ruleKeyBuilderFactory,new Lex(params,pathResolver,DEFAULT_LEX,ImmutableList.of("String_Node_Str"),DEFAULT_OUTPUT_SOURCE,DEFAULT_OUTPUT_HEADER,DEFAULT_INPUT));
  assertNotEquals(defaultRuleKey,flagsChange);
  RuleKey outputSourceChange=generateRuleKey(ruleKeyBuilderFactory,new Lex(params,pathResolver,DEFAULT_LEX,DEFAULT_FLAGS,Paths.get("String_Node_Str"),DEFAULT_OUTPUT_HEADER,DEFAULT_INPUT));
  assertNotEquals(defaultRuleKey,outputSourceChange);
  RuleKey outputHeaderChange=generateRuleKey(ruleKeyBuilderFactory,new Lex(params,pathResolver,DEFAULT_LEX,DEFAULT_FLAGS,DEFAULT_OUTPUT_SOURCE,Paths.get("String_Node_Str"),DEFAULT_INPUT));
  assertNotEquals(defaultRuleKey,outputHeaderChange);
  RuleKey inputChange=generateRuleKey(ruleKeyBuilderFactory,new Lex(params,pathResolver,DEFAULT_LEX,DEFAULT_FLAGS,DEFAULT_OUTPUT_SOURCE,DEFAULT_OUTPUT_HEADER,new TestSourcePath("String_Node_Str")));
  assertNotEquals(defaultRuleKey,inputChange);
}

Fixed version (ground truth):
@Test public void testThatInputChangesCauseRuleKeyChanges(){
  SourcePathResolver pathResolver=new SourcePathResolver(new BuildRuleResolver());
  BuildTarget target=BuildTargetFactory.newInstance("String_Node_Str");
  BuildRuleParams params=BuildRuleParamsFactory.createTrivialBuildRuleParams(target);
  FakeFileHashCache hashCache=FakeFileHashCache.createFromStrings(ImmutableMap.of("String_Node_Str",Strings.repeat("String_Node_Str",40),"String_Node_Str",Strings.repeat("String_Node_Str",40)));
  RuleKeyBuilderFactory ruleKeyBuilderFactory=new DefaultRuleKeyBuilderFactory(hashCache,pathResolver);
  RuleKey defaultRuleKey=generateRuleKey(ruleKeyBuilderFactory,new Lex(params,pathResolver,DEFAULT_LEX,DEFAULT_FLAGS,DEFAULT_OUTPUT_SOURCE,DEFAULT_OUTPUT_HEADER,DEFAULT_INPUT));
  RuleKey lexChange=generateRuleKey(new DefaultRuleKeyBuilderFactory(FakeFileHashCache.createFromStrings(ImmutableMap.of("String_Node_Str",Strings.repeat("String_Node_Str",40),"String_Node_Str",Strings.repeat("String_Node_Str",40))),pathResolver),new Lex(params,pathResolver,DEFAULT_LEX,DEFAULT_FLAGS,DEFAULT_OUTPUT_SOURCE,DEFAULT_OUTPUT_HEADER,DEFAULT_INPUT));
  assertNotEquals(defaultRuleKey,lexChange);
  RuleKey flagsChange=generateRuleKey(ruleKeyBuilderFactory,new Lex(params,pathResolver,DEFAULT_LEX,ImmutableList.of("String_Node_Str"),DEFAULT_OUTPUT_SOURCE,DEFAULT_OUTPUT_HEADER,DEFAULT_INPUT));
  assertNotEquals(defaultRuleKey,flagsChange);
  RuleKey outputSourceChange=generateRuleKey(ruleKeyBuilderFactory,new Lex(params,pathResolver,DEFAULT_LEX,DEFAULT_FLAGS,Paths.get("String_Node_Str"),DEFAULT_OUTPUT_HEADER,DEFAULT_INPUT));
  assertNotEquals(defaultRuleKey,outputSourceChange);
  RuleKey outputHeaderChange=generateRuleKey(ruleKeyBuilderFactory,new Lex(params,pathResolver,DEFAULT_LEX,DEFAULT_FLAGS,DEFAULT_OUTPUT_SOURCE,Paths.get("String_Node_Str"),DEFAULT_INPUT));
  assertNotEquals(defaultRuleKey,outputHeaderChange);
  RuleKey inputChange=generateRuleKey(new DefaultRuleKeyBuilderFactory(FakeFileHashCache.createFromStrings(ImmutableMap.of("String_Node_Str",Strings.repeat("String_Node_Str",40),"String_Node_Str",Strings.repeat("String_Node_Str",40))),pathResolver),new Lex(params,pathResolver,DEFAULT_LEX,DEFAULT_FLAGS,DEFAULT_OUTPUT_SOURCE,DEFAULT_OUTPUT_HEADER,DEFAULT_INPUT));
  assertNotEquals(defaultRuleKey,inputChange);
}