### Question:
DataTypeManager { public DataTypeManager withRefreshedSubDataTypes(final String newType) { return withSubDataTypes(makeExternalDataTypes(newType)); } @Inject  DataTypeManager(final TranslationService translationService,
                           final ItemDefinitionRecordEngine recordEngine,
                           final ItemDefinitionStore itemDefinitionStore,
                           final DataTypeStore dataTypeStore,
                           final ItemDefinitionUtils itemDefinitionUtils,
                           final ManagedInstance<DataTypeManager> dataTypeManagers,
                           final DataTypeNameValidator dataTypeNameValidator,
                           final DataTypeManagerStackStore typeStack); DataTypeManager fromNew(); DataTypeManager from(final ItemDefinition itemDefinition); DataTypeManager from(final BuiltInType builtInType); DataTypeManager from(final DataType dataType); DataTypeManager withParentUUID(final String parentUUID); DataTypeManager withName(final String name); DataTypeManager withType(final String type); DataTypeManager withConstraint(final String constraint); DataTypeManager withConstraintType(final String constraintType); DataTypeManager asList(final boolean isCollection); DataTypeManager withNoConstraint(); DataTypeManager withDataType(final DataType dataType); DataTypeManager withItemDefinition(final ItemDefinition itemDefinition); DataTypeManager withRefreshedSubDataTypes(final String newType); DataTypeManager withSubDataTypes(final List<DataType> dataTypes); DataTypeManager withNoName(); DataTypeManager withUniqueName(); DataTypeManager withUniqueName(final String name); DataTypeManager withItemDefinitionSubDataTypes(); DataTypeManager withIndexedItemDefinition(); DataType get(); List<DataType> makeExternalDataTypes(final String typeName); String structure(); String getTypeName(); DataTypeManager asStructure(); Optional<DataType> getTopLevelDataTypeWithName(final String typeName);  }### Answer:
@Test public void testWithRefreshedSubDataTypes() { final String newType = "newType"; final List<DataType> expectedDataTypes = asList(mock(DataType.class), mock(DataType.class)); doReturn(expectedDataTypes).when(manager).makeExternalDataTypes(newType); final DataType dataType = manager.from(makeDataType("uuid")).withRefreshedSubDataTypes(newType).get(); final List<DataType> actualDataTypes = dataType.getSubDataTypes(); assertEquals(expectedDataTypes, actualDataTypes); }