### Question:
MetadataService extends DatasourceService { protected ByteArrayInputStream createNewByteArrayInputStream( byte[] buf ) { if ( buf != null ) { return new ByteArrayInputStream( buf ); } else { return null; } } MetadataService(); static String getUploadDir(); void removeMetadata( String metadataId ); List<String> getMetadataDatasourceIds(); MetadataTempFilesListDto uploadMetadataFilesToTempDir( InputStream metadataFile,
      List<InputStream> localeFileStreams, List<String> localeFileNames ); MetadataTempFilesListDto uploadMetadataFilesToTempDir( InputStream metadataFile,
      List<FormDataBodyPart> localeFiles ); void importMetadataDatasource( String domainId, InputStream metadataFile,
                                        FormDataContentDisposition metadataFileInfo, boolean overwrite,
                                        List<FormDataBodyPart> localeFiles,
                                        List<FormDataContentDisposition> localeFilesInfo, RepositoryFileAclDto acl ); void importMetadataDatasource( String domainId, InputStream metadataFile, boolean overwrite,
      List<InputStream> localeFileStreams, List<String> localeFileNames, RepositoryFileAclDto acl ); boolean isContainsModel( String tempFileName ); void importMetadataFromTemp( String domainId, MetadataTempFilesListDto fileList,
      boolean overwrite, RepositoryFileAclDto acl ); RepositoryFileAclDto getMetadataAcl( String domainId ); void setMetadataAcl( String domainId, RepositoryFileAclDto aclDto ); static RepositoryFileImportBundle createNewRepositoryFileImportBundle( InputStream bais, String fileName, String domainId );  }### Answer:
@Test public void createNewByteArrayInputStream() throws Exception { byte[] buffer = null; ByteArrayInputStream stream = metadataService.createNewByteArrayInputStream( buffer ); assertNull( stream ); buffer = new byte[ 10 ]; stream = metadataService.createNewByteArrayInputStream( buffer ); assertNotNull( stream ); }