AtlasArrayType extends AtlasType { @Override public Collection<?> getNormalizedValue(Object obj) { if (obj == null) { return null; } if (obj instanceof String){ obj = AtlasType.fromJson(obj.toString(), List.class); } if (obj instanceof List || obj instanceof Set) { List<Object> ret = new ArrayList<>(); Collection objList = (Collection) obj; if (!isValidElementCount(objList.size())) { return null; } for (Object element : objList) { if (element != null) { Object normalizedValue = elementType.getNormalizedValue(element); if (normalizedValue != null) { ret.add(normalizedValue); } else { return null; } } else { ret.add(element); } } return ret; } else if (obj.getClass().isArray()) { List<Object> ret = new ArrayList<>(); int arrayLen = Array.getLength(obj); if (!isValidElementCount(arrayLen)) { return null; } for (int i = 0; i < arrayLen; i++) { Object element = Array.get(obj, i); if (element != null) { Object normalizedValue = elementType.getNormalizedValue(element); if (normalizedValue != null) { ret.add(normalizedValue); } else { return null; } } else { ret.add(element); } } return ret; } return null; } AtlasArrayType(AtlasType elementType);  AtlasArrayType(AtlasType elementType, int minCount, int maxCount);  AtlasArrayType(String elementTypeName);  AtlasArrayType(String elementTypeName, int minCount, int maxCount);  AtlasArrayType(String elementTypeName, AtlasTypeRegistry typeRegistry);  AtlasArrayType(String elementTypeName, int minCount, int maxCount, AtlasTypeRegistry typeRegistry); String getElementTypeName(); void setMinCount(int minCount); int getMinCount(); void setMaxCount(int maxCount); int getMaxCount(); AtlasType getElementType(); @Override void resolveReferences(AtlasTypeRegistry typeRegistry); @Override Collection<?> createDefaultValue(); @Override boolean isValidValue(Object obj); @Override boolean isValidValueForUpdate(Object obj); @Override Collection<?> getNormalizedValue(Object obj); @Override Collection<?> getNormalizedValueForUpdate(Object obj); @Override boolean validateValue(Object obj, String objName, List<String> messages); @Override boolean validateValueForUpdate(Object obj, String objName, List<String> messages); @Override AtlasType getTypeForAttribute();  }
@Test public void testArrayTypeGetNormalizedValue() { assertNull(intArrayType.getNormalizedValue(null), "value=" + null); for (Object value : validValues) { if (value == null) { continue; } Collection normalizedValue = intArrayType.getNormalizedValue(value); assertNotNull(normalizedValue, "value=" + value); } for (Object value : invalidValues) { assertNull(intArrayType.getNormalizedValue(value), "value=" + value); } }