public static String toString(Map<Unit<?>,Integer> product) {
        Map<Unit<?>, Integer> consolidated = consolidate(product);
        StringBuilder symbol = new StringBuilder();
        for (Map.Entry<Unit<?>, Integer> entry : consolidated.entrySet()) {
            if (symbol.length() != 0) {
                if (entry.getValue() == -1) {
                    symbol.append("/");
                } else {
                    symbol.append(".");
                }
            }
            symbol.append(entry.getKey().toString());
            if (entry.getValue() != -1 && entry.getValue() != 1) {
                symbol.append("^").append(entry.getValue());
            }
        }
        return symbol.toString();
    }