List<String> (@NotNull String typeString) { final Matcher arrayMatcher = NUMPY_ARRAY_PATTERN.matcher(typeString); if (arrayMatcher.matches()) { typeString = arrayMatcher.group(2); } Matcher matcher = NUMPY_UNION_PATTERN.matcher(typeString); if (matcher.matches()) { typeString = matcher.group(1); } return Arrays.asList(typeString.split(" *, *")); }