All language subtitles for 004 Quidditch Game – Part 2_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian Download
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

The solution is going to cover part two.

And the team constructor, through an illegal argument exception, if any of the fields are null or

any of the string values are blank.

Also, if housecalls null or if the keeper equals null or if the seeker equals null.

Then throw a new illegal argument exception.

Field values cannot be no.

Then say if a house is blank.

Or if keeper is blank.

Or if speaker is blank.

Throw a new illegal argument, exception.

Field values cannot be blank.

And finally, if the length of chasers is not equal to three.

Well, throw a new illegal argument exception.

Must have three chasers.

We need to throw another exception if the Chaser's Array contains an illegal element, the logic to

implement that without using loops is I consider meaningful code that we should write using test driven

development.

Accordingly, the first test case is to test if Chaser's Array has illegal elements.

So we'll write a unit test named has null test.

Inside the test, I'll define an era where the first element is known.

And the other two are filled.

And then you can use a search through.

To check if team has no.

Returns true for this array.

OK, now inside Team Java, we can write code to make the test fail.

I'll create a method that returns a boolean.

Named has no.

And for now, I'll just return false.

And I'm going to make this method static because I don't want to have to create an object just to call

a method that doesn't interact with any fields'.

I want to be able to call this method directly from the class.

So by making it static, we specify that this function belongs to the class.

Anyways, the test fails, OK, now we need to write code to make the test pass.

Inside the function, use a for loop that runs through the length of the array.

And we'll return true if any element is no.

Otherwise, return false.

Run the test.

And it passes.

But can this code be any simpler, can it be a refactored and the answer is a resounding yes, loops

are messy, and if you're able to use a stream pipeline, which is normally the case when you're dealing

with arrays or array lists, then use a stream.

In this case, we can use the arrays, utility class.

To call the method stream.

And remember that history is a sequence of elements that we can run through a pipeline of operations

and we're just going to apply the terminal operation any much, any match is going to compare every

element in the array against a predicates.

The lambda expression receives every element.

And any match is going to check if any element is equal to No.

And if any of them are not, any match is going to return, true, so we'll just return the result of

this pipeline.

Run the tests now and Perfect's.

One of the elements is known and the sequence of elements enters the pipeline as a stream and any match

returns true because one of the elements matches the predicates.

Can this could be any simpler than that?

No, we can move on.

OK, we also need to create a test that checks if any of the elements are black.

So once again, create a test that fails.

Public void has blank test.

And create an array where the first element is blank.

And then we can use a true.

To check if team has blank returns, true.

An outside team, Java, we can write code to make the test fail, I'll get a static method that returns

a boolean named has blank receives an array.

And for now, I'll just return false.

And the test fails.

OK, now we need to write some code to make it pass.

I'll skip the explanation, use the same pipeline as before.

But this one is going to return true if any of the elements happen to be blank.

Run the test.

And it passes.

There is no need to refactor this code.

We can move on.

OK, now in the constructor, I can say if The Chaser's Parameter has no.

Or has blank.

Then they need to throw an illegal argument exception.

Legal elements.

OK, now we can apply the same quality control inside the setas.

If House is Neller blank.

Through a new legal argument exception.

We'll copy this over here, change some things up.

One more time for speaker.

And that's it, and for chasers will check if chasers that length is not equal to three.

Or has no chaser's.

Or Chaser's has blank.

Then we'll throw a new illegal argument, exception, a legal chaser, arguments.

OK, now, before we wrap up, we seem to be using this code a lot.

So how about we create a function called Sheck Field?

That checks if some field is another blank.

So if the field being passed in is No.

Or blank, then we're going to throw a new illegal argument, exception.

That field cannot be null or blank.

And now wherever you can invoke this function.

You unit tested two methods, each method is modular and free of bugs and to make sure you can run every

test.

And seeing these beautiful green check marks is a good reminder that our code is working as it should.

You also added checkpoints to the team class, each checkpoint forbids the caller from misusing the

methods or constructor.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.