// Expect and Answer
  @Test
  public void testPerformAndTrackDiagnostic() {
    // xml
    IAnswer xmlPerformAndTrackDiagnostic =
        new IAnswer() {
          public Integer answer() throws Throwable {
            numberOfXmlDiagnosticPerformed++;
            return numberOfXmlDiagnosticPerformed;
          }
        };
    EasyMock.expect(xmlNameGeneratorMock.performAndTrackDiagnostic())
        .andAnswer(xmlPerformAndTrackDiagnostic);

    // html
    IAnswer htmlPerformAndTrackDiagnostic =
        new IAnswer() {
          public Integer answer() throws Throwable {
            numberOfHtmlDiagnosticPerformed++;
            return numberOfHtmlDiagnosticPerformed;
          }
        };
    EasyMock.expect(htmlNameGeneratorMock.performAndTrackDiagnostic())
        .andAnswer(htmlPerformAndTrackDiagnostic);

    // into replay mode
    EasyMock.replay(this.xmlNameGeneratorMock);
    EasyMock.replay(this.htmlNameGeneratorMock);

    // run the method
    int expectedXmlPerformAndTrackDiagnostic = 1;
    int actualXmlPerformAndTrackDiagnostic = this.nameGenerator.xmlPerformAndTrackDiagnostic();
    Assert.assertEquals(expectedXmlPerformAndTrackDiagnostic, actualXmlPerformAndTrackDiagnostic);

    int expectedHtmlPerformAndTrackDiagnostic = 1;
    int actualHtmlPerformAndTrackDiagnostic = this.nameGenerator.htmlPerformAndTrackDiagnostic();
    Assert.assertEquals(expectedHtmlPerformAndTrackDiagnostic, actualHtmlPerformAndTrackDiagnostic);

    // Verify behavior.
    EasyMock.verify(this.xmlNameGeneratorMock);
    EasyMock.verify(this.htmlNameGeneratorMock);
  }
 public int xmlPerformAndTrackDiagnostic() {
   return xmlNameGenerator.performAndTrackDiagnostic();
 }