private static boolean isBothTypes(Entity firstEntity, Entity secondEntity, Category firstType, Category secondType) {
            return firstEntity.isType(firstType) && secondEntity.isType(secondType) ||
                    firstEntity.isType(secondType) && secondEntity.isType(firstType);
        }