@Test
public void testOnDataChanged() {

    final ActorRef actorRef = getSystem().actorOf(MessageCollectorActor.props());
    ForwardingDataTreeChangeListener forwardingListener = new ForwardingDataTreeChangeListener(
            getSystem().actorSelection(actorRef.path()), ActorRef.noSender());
    Collection<DataTreeCandidate> expected = Arrays.asList(Mockito.mock(DataTreeCandidate.class));
    forwardingListener.onDataTreeChanged(expected);
    DataTreeChanged actual = MessageCollectorActor.expectFirstMatching(actorRef, DataTreeChanged.class, 5000);
    Assert.assertSame(expected, actual.getChanges());
}