### Question:
Strings { public static String removeFrozenBrackets(String input) { String unfrozen = FROZEN_PATTERN.matcher(input).replaceAll(String.valueOf(FROZEN_START)); if (input.length() == unfrozen.length()) { return input; } StringBuilder out = new StringBuilder(); OpenBrackets openBrackets = new OpenBrackets(); for (char c : unfrozen.toCharArray()) { switch (c) { case FROZEN_START: openBrackets.addStartBracket(); openBrackets.increaseAll(); break; case '<': openBrackets.increaseAll(); out.append(c); break; case '>': openBrackets.decreaseAll(); if (!openBrackets.removeLastIfClosed()) { out.append(c); } break; default: out.append(c); break; } } return out.toString(); } private  Strings(); static String removeFrozenBrackets(String input);  }### Answer:
@Test public void testNonFrozenString() { String input = "<Kalle>><"; String res = Strings.removeFrozenBrackets(input); assertThat(res).isEqualTo(input); }
@Test public void testNestedFrozenTypes() { String input = "<map<frozen<int>, frozen<list<frozen<blob>>>, frozen<text>>>"; String res = Strings.removeFrozenBrackets(input); assertThat(res).isEqualTo("<map<int, list<blob>, text>>"); }
@Test public void testFrozenWithoutBrackets() { String input = "frozen int <>"; String res = Strings.removeFrozenBrackets(input); assertThat(res).isEqualTo(input); }
@Test public void testFrozenWithExtraEndingBrackets() { String input = "frozen<list>>>"; String res = Strings.removeFrozenBrackets(input); assertThat(res).isEqualTo("list>>"); }