public static List<AstronomicalObject> sortByMass(List stm, int factor) {

        List<AstronomicalObject> sorted = stm;
        if (stm.size() > 0) {
            if (factor < 0) {
                Collections.sort(sorted, (B, A) -> MASS_COMPARATOR.compare(A, B));
                log.info("SortedByMass descending :{}");
            }
            if (factor >= 0) {
                Collections.sort(sorted, MASS_COMPARATOR::compare);
                log.info("SortedByMass ascending :{}");
            }
        }
        return sorted;
    }