1

00:00:01,120  -->  00:00:07,290
OK now let's look at the essentials demo specifically look at the asset statement itself and we will

2

00:00:07,290  -->  00:00:13,520
also look at the flaks the year flag under the Firaaq year for enabling officer issuance NBA for disabling

3

00:00:13,590  -->  00:00:14,220
officers.

4

00:00:14,240  -->  00:00:15,420
It's unreal.

5

00:00:15,440  -->  00:00:17,740
Specifically look at the year flag.

6

00:00:17,760  -->  00:00:25,080
The enabling flag at book Class unpackaged level under the flag only at a colossal event and we will

7

00:00:25,080  -->  00:00:26,980
also look at the year flag applied.

8

00:00:26,980  -->  00:00:27,700
But it's that.

9

00:00:27,730  -->  00:00:32,390
Without that without any restrictions at class or package of it.

10

00:00:32,550  -->  00:00:40,860
So here for this demo I created a new snapback package within exceptions called assertions and there

11

00:00:40,860  -->  00:00:50,560
are four classes which I've created a B C and D and A B and D going inside the assertions package on

12

00:00:50,700  -->  00:00:57,740
assertions also has a package quite Beaven on seed or July is placed inside be one.

13

00:00:58,230  -->  00:01:06,270
Now the main class is the Class 8 which means that it has a main method and within all four classes

14

00:01:06,390  -->  00:01:08,760
there is a best method.

15

00:01:09,300  -->  00:01:18,640
You can see it here in B B and C and within each element there has only one parameter in all the four

16

00:01:18,660  -->  00:01:19,780
classes on their stuff.

17

00:01:19,920  -->  00:01:21,330
It's a barometer.

18

00:01:21,340  -->  00:01:29,310
I am the first statement in all of the methods in each of the classes is an absurd statement.

19

00:01:29,310  -->  00:01:33,790
For example here in 8 or Java it is answered and it is simply checking.

20

00:01:33,800  -->  00:01:37,500
F I is greater than zero if it is greater than zero.

21

00:01:37,500  -->  00:01:38,530
We know that it is good.

22

00:01:38,570  -->  00:01:45,180
I can go with the next statement but if it is less than or equal to zero it means that our position

23

00:01:45,180  -->  00:01:52,410
is wrong and this message will be passed on to the as shown error which should be generated as a result

24

00:01:52,410  -->  00:01:53,390
of this failure.

25

00:01:53,550  -->  00:01:55,940
OK so in this case it is invalid.

26

00:01:55,950  -->  00:02:01,520
I in a test so similarly in beat or Jawa X is invalid.

27

00:02:01,530  -->  00:02:05,310
I n b dark dust and indeed are Java X's.

28

00:02:05,340  -->  00:02:11,840
In reality I indeed are dust and we have the similar statement and the class now.

29

00:02:12,780  -->  00:02:15,880
So Class C is inside the package be run here.

30

00:02:15,910  -->  00:02:20,290
OK just an ER doc and here in Class A.

31

00:02:20,400  -->  00:02:25,950
After the statement we are simply creating an instance of be an instance of C an instance of d n NBT

32

00:02:25,950  -->  00:02:29,770
are invoking the best matter that an argument minus one.

33

00:02:30,170  -->  00:02:35,940
I can beat or Java just has only the so its statement and seed Argile also just has only that sort of

34

00:02:35,990  -->  00:02:37,010
statement.

35

00:02:37,040  -->  00:02:42,990
Indeed our Java has no such statement but it is also creating an instance of B and is invoking that

36

00:02:43,200  -->  00:02:46,180
method that value minus one.

37

00:02:46,380  -->  00:02:48,430
So we will see why we are doing that.

38

00:02:48,480  -->  00:02:51,270
So let's just go ahead and run this.

39

00:02:51,270  -->  00:02:53,340
So by default it is disabled.

40

00:02:53,340  -->  00:02:55,010
All associates are disabled.

41

00:02:55,500  -->  00:03:00,500
So all these statements do not have any effect so far on it.

42

00:03:00,570  -->  00:03:07,710
So there is there is nothing happening just this Klaas's is running and this method is getting in work

43

00:03:08,160  -->  00:03:12,430
on all of these instances of getting created under US methods of getting in work.

44

00:03:12,540  -->  00:03:17,070
But those statements are disabled on Wednesday or not do you want to exit your date.

45

00:03:17,280  -->  00:03:25,800
So let's go ahead now and do the first test which is going to run us undrawn configurations.

46

00:03:25,800  -->  00:03:29,020
So we are going to enable it only for the Klasky.

47

00:03:29,210  -->  00:03:32,710
OK so let's go into arguments here.

48

00:03:33,390  -->  00:03:34,200
So this is for.

49

00:03:34,230  -->  00:03:35,290
This is for the Class A.

50

00:03:35,310  -->  00:03:40,790
OK we have done it right click on that and we have come here so we need to enable that only for class

51

00:03:40,930  -->  00:03:41,020
.

52

00:03:41,130  -->  00:03:43,020
So it would be hyphen.

53

00:03:43,620  -->  00:03:51,100
And this is the assertions doc a guess what we are enabling it for a.

54

00:03:52,230  -->  00:03:57,560
So when we run it we are passing minus one here and the method is getting invoked.

55

00:03:57,620  -->  00:04:02,740
And since it is less than or equal to zero it's printing the message invalid in a test.

56

00:04:02,800  -->  00:04:10,490
OK on your string assertion error not it's possible one here instead of minus one.

57

00:04:10,500  -->  00:04:13,310
Now we don't have such an error because this is true.

58

00:04:13,350  -->  00:04:16,220
Now this condition is true and we are going into the next statement.

59

00:04:16,650  -->  00:04:19,930
But assertions are unable and only for class A.

60

00:04:20,280  -->  00:04:25,990
So for that reason as assertions in any of these classes like B C and B are not executed.

61

00:04:26,280  -->  00:04:27,400
OK so now.

62

00:04:27,630  -->  00:04:29,520
So that's the first test.

63

00:04:29,570  -->  00:04:33,050
No let's just go ahead and label it for the package itself.

64

00:04:33,060  -->  00:04:33,540
Assertions.

65

00:04:33,550  -->  00:04:38,980
Package Berengar on as.

66

00:04:39,030  -->  00:04:41,480
So this is what we are doing it on class.

67

00:04:42,000  -->  00:04:43,950
Because that has the main matter.

68

00:04:43,980  -->  00:04:47,450
Once again let's pass the arguments the VM arguments here.

69

00:04:47,820  -->  00:04:51,750
Now here instead of a we are going to say since it's a package label.

70

00:04:51,770  -->  00:04:54,450
Is it docked three dots right.

71

00:04:54,480  -->  00:05:00,970
So that's for the package Acme applied here and it's run it.

72

00:05:01,540  -->  00:05:03,910
And now the associate set up Blyde.

73

00:05:04,000  -->  00:05:12,260
You can see that it's failing here for the test method in class B because we are passing a minus one

74

00:05:12,320  -->  00:05:17,570
understeering and associate error and the program is basically terminated in 1991 going to exit could

75

00:05:17,610  -->  00:05:18,980
any of these statements.

76

00:05:19,230  -->  00:05:27,330
So let's make this one SILVERDOCS SOTA statement and Glasby will work OK.

77

00:05:27,480  -->  00:05:31,040
But it is failing in class C.

78

00:05:31,080  -->  00:05:34,360
Ok that doesn't matter in class C because we are passing minus one.

79

00:05:34,650  -->  00:05:38,820
So the important thing to note here is the flag.

80

00:05:38,820  -->  00:05:42,230
The package level house specified it as assertions.

81

00:05:42,480  -->  00:05:49,810
But even though C is inside some baggage office notions that particular flag is still working.

82

00:05:49,950  -->  00:05:55,940
OK so the assertions have been unable for seed Argile also even doing it is part of a snapback edge

83

00:05:56,010  -->  00:05:56,190
.

84

00:05:56,230  -->  00:06:01,250
OK so the package level when we enable it at back is no wonder it would apply to both.

85

00:06:01,310  -->  00:06:06,320
All all the classes in that package and also any classes and sub packages.

86

00:06:06,340  -->  00:06:12,470
OK so that such package was not discussed earlier in the lesson so it would also apply for all packages

87

00:06:12,490  -->  00:06:12,700
.

88

00:06:12,890  -->  00:06:16,710
So let's also make this one now.

89

00:06:16,710  -->  00:06:17,960
Now everything is fine.

90

00:06:17,970  -->  00:06:22,210
It's only that in the class B there is an assertion outer and how.

91

00:06:22,290  -->  00:06:24,000
Because we are passing minus one.

92

00:06:24,300  -->  00:06:25,470
So that's the second best.

93

00:06:25,470  -->  00:06:29,270
Now let's just go ahead and disable it only for class D.

94

00:06:29,300  -->  00:06:30,840
So B stands for disabling.

95

00:06:30,840  -->  00:06:32,180
You can think that way.

96

00:06:32,220  -->  00:06:41,160
So it is going to aid our Java like going to run configurations here get into arguments and that's enabling

97

00:06:41,160  -->  00:06:42,090
.

98

00:06:42,090  -->  00:06:43,620
Now let's say discipling.

99

00:06:43,640  -->  00:06:44,630
It's Haifaa NBA

100

00:06:47,730  -->  00:06:49,510
needs to be D.

101

00:06:49,660  -->  00:06:51,640
K so let's apply.

102

00:06:51,700  -->  00:06:53,650
Sure on and on.

103

00:06:53,730  -->  00:06:59,190
As you can see now how does this it will be back within that dust method.

104

00:06:59,230  -->  00:07:03,420
Off D we are creating an instance off beat.

105

00:07:03,450  -->  00:07:06,260
So this statement is working fine because it's true.

106

00:07:06,510  -->  00:07:11,360
On the contrary comes here goes into best mentor and we are passing it minus one here.

107

00:07:11,540  -->  00:07:19,380
OK so since this is an instance of B so since we are passing minus one controller comes here on this

108

00:07:19,380  -->  00:07:25,450
phase underspending printing done invalid I indeed our best and you can see that back stack trace also

109

00:07:25,610  -->  00:07:26,250
says beat.

110

00:07:26,250  -->  00:07:32,790
Best indeed are best because it is invoking B and DS in don't invoke from a.

111

00:07:32,940  -->  00:07:35,120
And you can see the actress.

112

00:07:35,430  -->  00:07:37,550
So that's the third Test.

113

00:07:37,560  -->  00:07:42,130
Now let's just use only only that you like.

114

00:07:42,210  -->  00:07:45,700
OK so let's remove the package here.

115

00:07:45,720  -->  00:07:48,740
This will not make any difference in the output.

116

00:07:49,590  -->  00:07:53,190
So we are passing only EAF like to class A.

117

00:07:53,460  -->  00:07:57,170
So you are running a real running class A and we are passing on the flag.

118

00:07:57,210  -->  00:08:00,360
But we are also disabling only the class D.

119

00:08:00,780  -->  00:08:04,310
So we just go how to apply this.

120

00:08:04,620  -->  00:08:07,210
So once again it's the same output.

121

00:08:08,010  -->  00:08:13,900
So it means that the assertions are an amber since it's applied on a.

122

00:08:14,330  -->  00:08:15,350
It's a blight.

123

00:08:15,480  -->  00:08:19,110
It's an enabler for all classes that are being accessed from a.

124

00:08:19,170  -->  00:08:23,260
Which means except for B C and B.

125

00:08:23,280  -->  00:08:26,190
But in this case we have disabled it for beat.

126

00:08:26,520  -->  00:08:28,620
OK so it's disembody for me.

127

00:08:28,740  -->  00:08:30,610
So assertion is disabler here.

128

00:08:30,810  -->  00:08:36,980
But then since D is also invoking B cert it is also applied for B.

129

00:08:37,170  -->  00:08:45,600
So it is basically applied for a any unidentified object tree that is that gets created from Iran where

130

00:08:45,640  -->  00:08:50,160
it's ok including an object that is getting created somewhere inside.

131

00:08:50,280  -->  00:08:56,100
So that is we are in working creating an instance of B and within be an instance another instance of

132

00:08:56,100  -->  00:09:00,570
B is created and an assertion is also applied for that also.

133

00:09:00,660  -->  00:09:03,800
OK this one.

134

00:09:04,020  -->  00:09:05,490
So that's about it.

135

00:09:05,850  -->  00:09:12,930
That's how you were unable undecidable assertions and just all the discord is in the resources section

136

00:09:12,930  -->  00:09:12,950
.

137

00:09:12,960  -->  00:09:17,150
So you can go ahead and download and play with it and that's it.

138

00:09:17,190  -->  00:09:18,470
Thank you and happy coding
