NuoDBColumn { public static Collection<String> getEnum(String type) { boolean start = false; boolean escape = false; char[] symbols = type.toCharArray(); StringBuilder value = new StringBuilder(); Collection<String> values = newArrayList(); for (int index = 0; index < symbols.length; index++) { char symbol = symbols[index]; if (escape) { value.append(symbol); escape = false; continue; } switch (symbol) { case '\\': escape = true; break; case '^': if (start) { values.add(value.toString()); value.setLength(0); } if (!start) { start = true; } break; default: value.append(symbol); break; } } return values; }  static JdbcType getJdbcType(JdbcType baseType, String type); static Collection<String> getEnum(String type);  }
@Test(dataProvider = "getEnum") public void testGetEnum(String type, Collection<String> values) { assertEquals(getEnum(type), values); }