CheckPath (@NotNull FilePatch patch) { String beforeFileName = patch.getBeforeName(); String afterFileName = patch.getAfterName(); if (beforeFileName == null || patch.isNewFile()) { return new CheckAdded(patch); } else if (afterFileName == null || patch.isDeletedFile()) { return new CheckDeleted(patch); } else if (!beforeFileName.equals(afterFileName)) { return new CheckMoved(patch); } else { return new CheckModified(patch); } }