public void notifyTestResult(ObjectReader reader) {
    final TestProxy testProxy = reader.readObject();

    if (testProxy.getParent() == null) { // model.getRoot() == testProxy
      getDynamicParent(myModel, testProxy).insertNextRunningChild(testProxy);
    }

    final int state = reader.readInt();
    final StateChanger stateChanger = STATE_CLASSES.get(state);
    stateChanger.changeStateOf(testProxy, reader);
    synchronized (myCurrentTests) {
      if (stateChanger instanceof RunningStateSetter) {
        myCurrentTests.add(testProxy);
      } else {
        myCurrentTests.remove(testProxy);
      }
    }
  }
 public static void mapClass(final int magnitude, @NotNull StateChanger factory) {
   factory.setMagnitude(magnitude);
   STATE_CLASSES.put(magnitude, factory);
 }