@Override
  public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
      throws CoreException, OperationCanceledException {

    RefactoringStatus status = new RefactoringStatus();

    if ((!(getTargetFragment() instanceof TestMethod)) || (getTargetFragment() == null)) {
      status.merge(
          RefactoringStatus.createFatalErrorStatus("Selection is not valid. Select a method."));
    } else {
      targetMethod = (TestMethod) getTargetFragment();
    }

    if (status.hasEntries()) {
      status.merge(
          RefactoringStatus.createFatalErrorStatus(
              "Note: Select the bigger method wich groups smaller ones, press group incremental tests, all asserts will be brought to the selected method, the smaller methods will be removed."));
    }
    return status;
  }