@Test
public void testThatNameChangeIsCalledInitiallyButNotAgainIfNameIsSame() {

  final String name = "QUACKERY!";
  final int[] publishNameChangedCallCount = {0};
  final TestNetworkPublisher publisher = new TestNetworkPublisher() {
    @Override
    protected void publishNameChanged(Optional<String> oldName, String newName) {
      publishNameChangedCallCount[0]++;
      assertEquals("Name was not the new name", name, newName);
    }
  };
  publisher.setName(name);
  assertEquals("publishNameChanged was called an unexpected number of times", 1,
      publishNameChangedCallCount[0]);
  publisher.setName(name);
  assertEquals("publishNameChanged should not have been called agian", 1,
      publishNameChangedCallCount[0]);
}