AM/PM to 24 hour time conversion
It's not clear how many digits the output is supposed to have.  For midnight, you output "00", but for 1 am to 9 am, you echo the hour, which may or may not have a leading zero.

Taking the last two characters as the suffix, then doing time.replace(suffix, ""), feels like a fragile operation.  Consider treating this as a pattern-matching exercise instead, and using a regular expression.  Since the pattern also describes the valid input strings, you get input validation for free.

private static final Pattern TIME12 = Pattern.compile(
    "(?&lt;h&gt;0?\\d|11|12):(?&lt;ms&gt;[0-5]\\d:[0-6]\\d)\\s*(?&lt;ampm&gt;[AP]M)"
);

public static String time24(String time12) {
    Matcher m = TIME12.matcher(time12);
    if (!m.matches()) throw new IllegalArgumentException();

    int h = "12".equals(m.group("h")) ? 0 : Integer.parseInt(m.group("h"));
    if ("PM".equals(m.group("ampm"))) h += 12;
    return String.format("%02d:%s", h, m.group("ms"));
}