AtlasArrayType extends AtlasType { @Override public boolean isValidValue(Object obj) { if (obj != null) { if (obj instanceof List || obj instanceof Set) { Collection objList = (Collection) obj; if (!isValidElementCount(objList.size())) { return false; } for (Object element : objList) { if (!elementType.isValidValue(element)) { return false; } } } else if (obj.getClass().isArray()) { int arrayLen = Array.getLength(obj); if (!isValidElementCount(arrayLen)) { return false; } for (int i = 0; i < arrayLen; i++) { if (!elementType.isValidValue(Array.get(obj, i))) { return false; } } } else { return false; } } return true; } 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 testArrayTypeIsValidValue() { for (Object value : validValues) { assertTrue(intArrayType.isValidValue(value), "value=" + value); } for (Object value : invalidValues) { assertFalse(intArrayType.isValidValue(value), "value=" + value); } }