From 8db6aff4bba60f64ae7693ca7cb2b44d6b5a7d83 Mon Sep 17 00:00:00 2001 From: Brian Patterson Date: Fri, 29 Nov 2019 09:54:24 -0500 Subject: [PATCH] Completed Lab --- .idea/.gitignore | 4 + .idea/Lambdas2-ZCW.iml | 25 ++++ .idea/compiler.xml | 16 +++ ...thub_stefanbirkner_system_rules_1_19_0.xml | 13 ++ .idea/libraries/Maven__junit_junit_4_9.xml | 13 ++ .../Maven__org_hamcrest_hamcrest_core_1_1.xml | 13 ++ .idea/misc.xml | 14 ++ .idea/modules.xml | 9 ++ .idea/uiDesigner.xml | 124 ++++++++++++++++++ .idea/vcs.xml | 6 + Lambdas2ZCW/Lambdas2ZCW.iml | 18 +++ Lambdas2ZCW/pom.xml | 26 ++++ rocks/zipcode/CheckOlderThan40.class | Bin 0 -> 566 bytes rocks/zipcode/CheckPerson.class | Bin 0 -> 160 bytes rocks/zipcode/LocalSearch.class | Bin 0 -> 1371 bytes rocks/zipcode/Main$1Under30.class | Bin 0 -> 674 bytes rocks/zipcode/Main.class | Bin 0 -> 2635 bytes rocks/zipcode/Person$Sex.class | Bin 0 -> 1017 bytes rocks/zipcode/Person.class | Bin 0 -> 2423 bytes rocks/zipcode/PersonTest.class | Bin 0 -> 3172 bytes rocks/zipcode/Searches.class | Bin 0 -> 277 bytes rocks/zipcode/SearchesTest$1Under30.class | Bin 0 -> 805 bytes rocks/zipcode/SearchesTest.class | Bin 0 -> 3226 bytes rocks/zipcode/SocialNetworks.class | Bin 0 -> 986 bytes rocks/zipcode/SocialNetworksTest.class | Bin 0 -> 2220 bytes .../java/rocks/zipcode/CheckOlderThan40.java | 13 ++ src/main/java/rocks/zipcode/CheckPerson.java | 6 + src/main/java/rocks/zipcode/LocalSearch.java | 21 +++ src/main/java/rocks/zipcode/Main.java | 57 ++++++++ src/main/java/rocks/zipcode/Person.java | 87 ++++++++++++ src/main/java/rocks/zipcode/Searches.java | 7 + .../java/rocks/zipcode/SocialNetworks.java | 29 ++++ src/test/java/rocks/zipcode/PersonTest.java | 98 ++++++++++++++ src/test/java/rocks/zipcode/SearchesTest.java | 57 ++++++++ .../rocks/zipcode/SocialNetworksTest.java | 39 ++++++ 35 files changed, 695 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/Lambdas2-ZCW.iml create mode 100644 .idea/compiler.xml create mode 100644 .idea/libraries/Maven__com_github_stefanbirkner_system_rules_1_19_0.xml create mode 100644 .idea/libraries/Maven__junit_junit_4_9.xml create mode 100644 .idea/libraries/Maven__org_hamcrest_hamcrest_core_1_1.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/uiDesigner.xml create mode 100644 .idea/vcs.xml create mode 100644 Lambdas2ZCW/Lambdas2ZCW.iml create mode 100644 Lambdas2ZCW/pom.xml create mode 100644 rocks/zipcode/CheckOlderThan40.class create mode 100644 rocks/zipcode/CheckPerson.class create mode 100644 rocks/zipcode/LocalSearch.class create mode 100644 rocks/zipcode/Main$1Under30.class create mode 100644 rocks/zipcode/Main.class create mode 100644 rocks/zipcode/Person$Sex.class create mode 100644 rocks/zipcode/Person.class create mode 100644 rocks/zipcode/PersonTest.class create mode 100644 rocks/zipcode/Searches.class create mode 100644 rocks/zipcode/SearchesTest$1Under30.class create mode 100644 rocks/zipcode/SearchesTest.class create mode 100644 rocks/zipcode/SocialNetworks.class create mode 100644 rocks/zipcode/SocialNetworksTest.class create mode 100644 src/main/java/rocks/zipcode/CheckOlderThan40.java create mode 100644 src/main/java/rocks/zipcode/CheckPerson.java create mode 100644 src/main/java/rocks/zipcode/LocalSearch.java create mode 100644 src/main/java/rocks/zipcode/Main.java create mode 100644 src/main/java/rocks/zipcode/Person.java create mode 100644 src/main/java/rocks/zipcode/Searches.java create mode 100644 src/main/java/rocks/zipcode/SocialNetworks.java create mode 100644 src/test/java/rocks/zipcode/PersonTest.java create mode 100644 src/test/java/rocks/zipcode/SearchesTest.java create mode 100644 src/test/java/rocks/zipcode/SocialNetworksTest.java diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..e891fab --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,4 @@ +# Default ignored files +/workspace.xml +# Project exclude paths +/../ \ No newline at end of file diff --git a/.idea/Lambdas2-ZCW.iml b/.idea/Lambdas2-ZCW.iml new file mode 100644 index 0000000..b8ca93c --- /dev/null +++ b/.idea/Lambdas2-ZCW.iml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..7105f96 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_github_stefanbirkner_system_rules_1_19_0.xml b/.idea/libraries/Maven__com_github_stefanbirkner_system_rules_1_19_0.xml new file mode 100644 index 0000000..638bae2 --- /dev/null +++ b/.idea/libraries/Maven__com_github_stefanbirkner_system_rules_1_19_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__junit_junit_4_9.xml b/.idea/libraries/Maven__junit_junit_4_9.xml new file mode 100644 index 0000000..c42d5ab --- /dev/null +++ b/.idea/libraries/Maven__junit_junit_4_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_1.xml b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_1.xml new file mode 100644 index 0000000..acdf443 --- /dev/null +++ b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..89d2930 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..fe257e2 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Lambdas2ZCW/Lambdas2ZCW.iml b/Lambdas2ZCW/Lambdas2ZCW.iml new file mode 100644 index 0000000..ccdb0fd --- /dev/null +++ b/Lambdas2ZCW/Lambdas2ZCW.iml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Lambdas2ZCW/pom.xml b/Lambdas2ZCW/pom.xml new file mode 100644 index 0000000..23e0ca3 --- /dev/null +++ b/Lambdas2ZCW/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + com.zipcodewilmington + Lambdas2ZCW + 1.0-SNAPSHOT + + + junit + junit + 4.9 + test + + + com.github.stefanbirkner + system-rules + 1.19.0 + test + + + + + \ No newline at end of file diff --git a/rocks/zipcode/CheckOlderThan40.class b/rocks/zipcode/CheckOlderThan40.class new file mode 100644 index 0000000000000000000000000000000000000000..dd1679f07eb2a8525ca24eb2cec8a37089afe180 GIT binary patch literal 566 zcmaJ;O;5r=6r62KE9FxJ6u+W3(8PM+hA}ZDCMGCG3#pN+=uHG_Yl$!l0iyo)eujsMT7RL2LSb z!H{b?p17Gl_C#>cdoFbfE#KyDmj{kKFPd63bV7!MR^Z#?(0X`9>m)7%J7J(OVIOzSpQdP?AZ^8Op0?7&4uR+v96KS*$lZ{xq<~r6U8Dmbada z_!CbAumOi%e{fs?u~>kGq2FhV>1;0-u<@qfru^!6p9}83WreX zRmJ!p!j-lzjCC q32mm%sG&ldWC=l=k~EwmD`{4q3l?T1MGkqgTaQ&NMYKRv!Nv~@g?F3) literal 0 HcmV?d00001 diff --git a/rocks/zipcode/CheckPerson.class b/rocks/zipcode/CheckPerson.class new file mode 100644 index 0000000000000000000000000000000000000000..e182034c46b79335ba4fe433646c868f56895869 GIT binary patch literal 160 zcmX^0Z`VEs1_l!bPId-%b_Nbc29}c4;u1y%Ne!Q({N(In{i@7@;`}^o z%_v3&uHgLAqU2P!%$!t41_9@c)Z}c4tX@`PSt3v`s!k*YK;H7XjS*gh- eY>W(y3`{^bFfcH(FfuSRuz*+$tU!{9feiqQ?kLXy literal 0 HcmV?d00001 diff --git a/rocks/zipcode/LocalSearch.class b/rocks/zipcode/LocalSearch.class new file mode 100644 index 0000000000000000000000000000000000000000..47acffaa7714e45976b5c62face9bb407f9e80f0 GIT binary patch literal 1371 zcma)5OHUI~6#i}>3~dJ~70XMpC~BdFD&n(^8KObz-^jENf) z*|^ad3@(go|Aha;81=hTD$|CAv$*HnbH01dcOLWo_m{5#=8+FWMKXdZOh=GHS{^eB zW+UiBCX67ihIm{HVGh^jbzZ>@1veGk66jelOv70e@F%CX1OhAd9bKTmV3_(w^Vzm; zJ<+ynw8RSal2+T&EJNOpi~*-&*aBk(t6r+wnU_YR#OE0oTGTbGRLKgc4a+c{P2IBV zCc(4G!mjpQ%QPLMmMIvvlkIxFQqfD*7Cb8{iH1PD3v=WqeXDLex+M_pj!K`Sw|w3F zycuNdj>=v%+SPRvT{xMLm;3KfT`9aw-SNnh z1V)lwxOTgqvg(H0X@PLD-n2@3&XD7adS)^!`>)~@`W4(!aTi$7vyVp7Et`c*7rRl%By99C64#3M55eB#N*-0r+_IO_8U$`sc80wzDG2do2?0$?q#rz_fR4_;@MNSv8dioGP zf%Wtu`~t5qP9-4l4Z)4n%prPwv?((OQ1<`)kU0WwjyPii3P#b3Nybf*WQy5j&IDnAj=cu=sN#8hc=Ut2c7Ze4F#7}aYpv8v^M02%xO3qbUe3XgQ zC-iavI~rJ)EB8;B3t3| a2*NkMBnY@nh!0n=LK&uWjzvFM8u<$%AUj|H literal 0 HcmV?d00001 diff --git a/rocks/zipcode/Main$1Under30.class b/rocks/zipcode/Main$1Under30.class new file mode 100644 index 0000000000000000000000000000000000000000..bd61d9f712c925626a49a77ef0810e2f7cd1eca5 GIT binary patch literal 674 zcmaJ;&rcIU7=6>-c46I0L98Nz0wpP$xDvh97)_%INsA^$4sx1qC+*N>w%J`g`0se| z!i5Va9{dCRql|C1HKfLPnE8Ia@6G$>`}ynp4*<`x>%+yGk9%16aNom*hfRUX3vG1% zQow2M9SgYaWS|6=I@+ki^RvE6k7Pe)W~GxvGCr26w(%_K<|Ca6cpuC_rO%!U1P8{b zv>nSVQ!H$B(j*#Z;b%RG$QyR0HjVumy2aOWmE{6!&A)K(RhlKHwfB+wCWS9h|2IaU z+RJ4$?#jtbl;2Cv(@4G5R`#NO^2w?EBstU@6U9lU&9JNTQ8MuGAizUx1*pLDupM9r z4T1IlXcnkht}vEn7{2SDs>sTpZ)lHHG@eetZ=0`KH5~h_F!kn1=bEjTr&QLmOIV$6 z`omQjs{HkkLvd9H6z*`J0%b0@#KRdFEzk>T1#S7!H;BukyjTEiatl81U<$wu++@VB zL5;U1KJohVH=YlB**EEfSrapzvXxM~htdQsy(PfmXuc#HP3`)3- SI<1R4xQi-1pD>3u0Dc23Bae3g literal 0 HcmV?d00001 diff --git a/rocks/zipcode/Main.class b/rocks/zipcode/Main.class new file mode 100644 index 0000000000000000000000000000000000000000..7b4ed646a9ccad21d2ffce49b0878459975658eb GIT binary patch literal 2635 zcma)8*>@9F9R4QTohCy`xtvwNNM)+k&K20&dfEXs1mxaWVypyMhbu z%Zo2Q=mXDqJOxD2<0CJ6jz0M2Kj85X;CQUxoup|Ji^p@?dw=)0e)qTB$?d2u~x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Ed(t0&|M~&IHEf2_hubplD7YKO zG}3J}W)x(@Xu^zwS+So}FfaD^!uSk1v04zT`wH@6QxKP;xI7S-hvM?Nf<*;OV!141 zMaHUx*4u_@*mor~CkD9<%~Z;|gh<{n_2S;nnr zoXT63(pS~wYh$;>cjWpcH?R3l0k3|nmeAQqDTWgR$|}a7tC+yLimTXAaT9A2Vos1?#se6ygGLoopr*Zz$Ov%>swUxswJr9*A>N|A z5;_`aD50sc&fZSsa=F1nL=F`)`8f%z3HN!hV;Y`l*!YgZ^#Q~*w$9JF891D5=V-0* zGwd0Qq*T#7mOb}1d!9|vl2}*}2RjoU|&!yFgT%h#RwYX|F%)4ZPHF3G#Zd&`w~kbdT(31@k2b&PE|$F=G@ z;1itZPGYFj^b&`^rC&4e?;z)$2TDx-OHmwiTRcp2 zp_b^R6W|1~on)^@oP_7ypkBg0BEN`BOgzT_ey*BunMno2PaQx5KA<0IZJ{lDR6s-f zXuli1a6Qx&dUN*8d#E*prx+9HAi_=}=)xqrIT$_2&?3rn&CTee9rV%0J+zZJfdmH0 zY6@+*!d1v;Fyt^8_8GW)mbnJN)#7YG3&~4%PzLwVh#%y8uMFvrD8q?jy!lqBFEsKV zCuEr*&!#{si z{KN6cKBB|>Ad5&ni*t}!?jf=mCW{eVCyEqDV4Ax*j0c#^`%FfBCfy#B6i3KqGR=66 zn2h;M-hMQbeZ-0fb5qa6)nk%Ot`qxB>M=zYx5y&(KUqv7Mi%4L!(}mEr^kfP;)BOx z`N(?20sgp(A z<5h6fspoao=k0D+88AmI~;`Gca8 zzzqs>%OP;1PMDiMf#VE%XEEM&82&}#Un2fx;$LBFt+GiT1@Iql(5HO-A3f+p@$P-} zPzJK-u4m!4(i5_HN*2#JB+oe*FUaC08%YZ=InJOrQ6cfcOffzX=J)6tca!P9e*jnh BFC72? literal 0 HcmV?d00001 diff --git a/rocks/zipcode/Searches.class b/rocks/zipcode/Searches.class new file mode 100644 index 0000000000000000000000000000000000000000..f58c26e5aa195b578c8d078dad81d8134858ff34 GIT binary patch literal 277 zcmZvWy>7xl5QJxqf54c4Qbe?LK*2S1L^P37Sx^wspN|t97#p1p1#guKDMcQDheBB+ z=&~z)x|!WM?e+Ha3t)^+h#Fb}UIMfU{=3OcIVIHkgC)WJ$XA-sj!mX#$9Gd8Nr1| zc>6y~=u}H0mDyU%ldV=IdT{vks)(D@OrMpwYrq>`K;LXQ2$(+G;6R-j-QOM>2w4%D HOb5{)I|({X literal 0 HcmV?d00001 diff --git a/rocks/zipcode/SearchesTest$1Under30.class b/rocks/zipcode/SearchesTest$1Under30.class new file mode 100644 index 0000000000000000000000000000000000000000..e0fe62bdb491d8f518f753260a48b5a7414cf51a GIT binary patch literal 805 zcmaJfgc5Ph3CH8Bo$OB-k@ZJ|j?T8V(*R#br^kSe7uQbG^hHk(zljk}I^9lrh! z2QFMV01^j&06z*bPEAQF(SvtqX5YMhZ@j;L|M&^uG3rG)SoKiAZ4YZ$cd_B(j*Ght zbICy2$^(YgmWjpCHa@74hj=aUBW$4S|xi7>$S^(^TAF6Wt(A08z2v&e!>o%0ItdA7 zSiUIlr8G9yyY<)PVKj*u$`?2@3`41%a4|gKqfDIFj>ksG7b=xMKRuHBC;Sa3lh3t? zVykrjKqiB@=VH@G1yvs|uJ|aT>SD{sJ=7RB|3Bb!BMf0m+=#gDH;%d|Qly?{8=C_u zhG&u)R%XwpB{D3%HHya4k?)dD+n3|#om7}i+kE&NG+M_(Jc-uQ)!M496_ho|dX{9b&w@{+Be1^g`%u`1A2^%BC z0P%#4_y; PR&Wa;MX7d&_5k<;kg&HK literal 0 HcmV?d00001 diff --git a/rocks/zipcode/SearchesTest.class b/rocks/zipcode/SearchesTest.class new file mode 100644 index 0000000000000000000000000000000000000000..1881eb0c4997320cc1bb4bc4e85c1983a6a9ea6c GIT binary patch literal 3226 zcmb7G+jAS$8UL*$Ygg+Hkz^~0LNEqGu^lVA_>vpYI3Y<5a*}2f7nO2Z%Nu)bX;-XP zB&HN-OYh}gN`YQx`qHP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GI)lhzd@q^h&}i_wg17bD z6k*(taGX+<(f@=QN-<)*i4&Cii1aK@Qi>DrG9I8L6Sa&}loVnQ;WW$v>}hAS+_JFer-^j+omus?nG zI=(`svW|NWT*pXnF^-e39C<3S5GOD~E(IgIf}m|4GUW0s&JlQH8|P^g!Pouq0>(L~ R`8>?|0RNBjgg-i-{Q`4KKj#1d literal 0 HcmV?d00001 diff --git a/rocks/zipcode/SocialNetworks.class b/rocks/zipcode/SocialNetworks.class new file mode 100644 index 0000000000000000000000000000000000000000..074fee43aa21eeeec8f1ad4d77642d6718fec040 GIT binary patch literal 986 zcma)*-EPxB5QWb=PTV9WNmCjK{ejYgk|5z5?ow6aM_gG2DX0jz+BjC&*0n3!0l`y& z1gZdu2jHO)XA{#jrmDEedS`a#J7?C;uixK)0(gMC6S9;k6B(@E?LbaKbLZX9_>iStpNc+tprp8IhU zh5bFYm3CFA(mjDfr+Xk^KIXYV-BqE#KRF)y@e4T&m}$C^CxZhSD;;M^GkvQPfz2F# z5P3=l`!ll%MJi)I%|eno-JCsE^!`a+;tru@B8|SZP>WNqxp3|jAQvh-?@z?lr8MoXycB+`r;KYviQcPgg}O4=h^Vk z_b6VQLp4ueHG6O8s`}m6*y4v^@dFY3QIgLJcLu5`a!-F;Ys@@CVOrDZokH|}z<70v z!dIA|r`2_?HCBKGlY~0^8;tB(50=qn#8GjTY|V2RY0YBq3(Qa47;FN~=w$6&b1`e4 z*;?hfjTTo8c|%Eq&$XN>&Aj&wMFTJA{+e_K!c2Op)5#5b(H>hfL?%NRuHiZb1h4+D m&=b~ZA^SqI{zqv}m7Q~ZsG)X5j-D6J= z2*uL9EB}BS-MGNwRZ?Q<#ws>0+~`kmYZX-%Wr^qZbe<$uP2YR&J?A@*@0{s=`tSEo z035>&6|Z8FV@gE~lPUD#EXO-4l8wVO$2o!XDhilMVHOtzE~*fCSKyL7n*x^wt_aKt zyeII!KvCcWfvW-^3S1NTNZ@0EPo#HCF7wiLiDQAoW)Q9&-1PjF8beRP_ev|Z+-;{? z@)qoz>6IL-JR9jp8I+oB`K2X>t}T`YuVj_YP$|t$I<6DE#SqW-%`qe<$QeUx!Ex=` zdS%}BFI)3vy2*sFIm>tCIl4>)OAh6-Z%c&Dxm>nu0R>9d?BGh3fjRU{Gw`bI*F1NS zp<@gDVyGZUWRhQ#j;=|^)})~|>G+y7ye6HXz*XC>QkI=pcZ$<&23Bch#;S&8g=C-O z7-29j)!o3U*mF+Jp{h^2t`}H=DB#`J>^JFJ6|ShVA;B1X?PuPFm(T4hc)cOe#&sO&4%7;IDpp}+BO?BxFu4?sgW+n zbq$MH;&3#SQK72rish6C$E<|~->%gLN?t`~;}YVMpD0_kn&dPwbGk4| zKDQlVi6ftL*+#H1K{N0jcX4#v@H;zs*@1j1C{vS-@NpUonz`(@4o0PEe9feHAxEE9$O)%44krIF zv}Wlv6P|&t{)b@wj}a?AMEpJyBqm8z?t|YYvl#klZ6RYIg#=Wzq6z(U(#R3PaS(@S zXE;o*W72gj3x#aJ4m^e^W>RVXvo7?WM^L{*Q$~A;=0d1wN%LRzCS45`tr?vZGod1# z=0EC+-WDM;q?ipAyVCrg5RrWwU5_Nf`}Q<{n$%k&`wpo{hKkNK|BdVI5n{JgD51hg z^ScQp0_>6ZJiPBp^WSw%Uyac%H9{9ZP$BVyW-)QdEG7?|Ma4*%MQ$X`qA(P*s4E7i zl^enwNyU$=?W&P_@)c5_tL*C+&(<&6`|lxPq}tW|1MCfze@c$yA;%-cGN8ji8hK=J z9=lLN8}6VTU!nuwq7%PhH=e;@3c6St-E1%I`_U8j<2H5VZ}KsK98{LVo`xj*5cSAl zO*n!<>Qx?p(KAT>I*&hal%zPt`iVZ=gVf_Y_y$8HB`NL~I8Ks6(QjgyBu+V8!wHfE zWs<|27@@fsrOfk4yr2Y{I8Jh$+TlkZP&`NTKZvpCRO#D= 40) { + return true; + } + return false; + } + +} diff --git a/src/main/java/rocks/zipcode/CheckPerson.java b/src/main/java/rocks/zipcode/CheckPerson.java new file mode 100644 index 0000000..430bd27 --- /dev/null +++ b/src/main/java/rocks/zipcode/CheckPerson.java @@ -0,0 +1,6 @@ +package rocks.zipcode; + +public interface CheckPerson { + + boolean test (Person person); +} diff --git a/src/main/java/rocks/zipcode/LocalSearch.java b/src/main/java/rocks/zipcode/LocalSearch.java new file mode 100644 index 0000000..38b3cc2 --- /dev/null +++ b/src/main/java/rocks/zipcode/LocalSearch.java @@ -0,0 +1,21 @@ +package rocks.zipcode; + +import java.util.List; + +public class LocalSearch implements CheckPerson{ + public static void printPersons(List roster, CheckPerson tester) { + for (Person p : roster) { + if (tester.test(p)) { + p.printPerson(); + } + } + } + + @Override + public boolean test(Person person) { + return person.gender == Person.Sex.FEMALE && + person.getAge() >= 0 && + person.getAge() <= 80; + + } +} diff --git a/src/main/java/rocks/zipcode/Main.java b/src/main/java/rocks/zipcode/Main.java new file mode 100644 index 0000000..583ff2a --- /dev/null +++ b/src/main/java/rocks/zipcode/Main.java @@ -0,0 +1,57 @@ +package rocks.zipcode; + +import java.time.LocalDate; +import java.util.List; + +public class Main { + + public static void printPersons(List roster, CheckPerson tester) { + for (Person p : roster) { + if (tester.test(p)) { + p.printPerson(); + } + } + } + + public static void main(String[] args) { + SocialNetworks networks = new SocialNetworks(); + + Person person1 = new Person("Brian", LocalDate.of(1986, 8, 30), Person.Sex.MALE, "email1@address.com"); + Person person2 = new Person("Rando", LocalDate.of(1999, 11, 10), Person.Sex.FEMALE, "random@email.com"); + Person person3 = new Person("Peoples", LocalDate.of(1983, 6, 20), Person.Sex.MALE, "email30@address.com"); + Person person4 = new Person("Jojo", LocalDate.of(1972, 5, 5), Person.Sex.FEMALE, "random2@email.com"); + Person person5 = new Person("Faye", LocalDate.of(1994, 2, 14), Person.Sex.MALE, "email25@address.com"); + Person person6 = new Person("Boberto", LocalDate.of(2003, 4, 21), Person.Sex.FEMALE, "random45@email.com"); + Person person7 = new Person("Guy", LocalDate.of(1969, 1, 3), Person.Sex.MALE, "email50@address.com"); + Person person8 = new Person("Smiley", LocalDate.of(2008, 12, 8), Person.Sex.FEMALE, "random77@email.com"); + Person[] peeps = {person1, person2, person3, person4, person5, person6, person7, person8}; + + for (int i = 0; i < peeps.length; i++) { + networks.add(peeps[i]); + } + + class Under30 implements CheckPerson { + @Override + public boolean test(Person person) { + return person.getAge() <= 30; + } + } + + + + CheckPerson maleOver30 = new CheckPerson() { + @Override + public boolean test(Person person) { + return person.getAge() >= 15 && person.getAge() <= 50; + } + + }; + + printPersons(networks.get(), new Under30()); + + printPersons(networks.get(),maleOver30); + + printPersons(networks.get(), person -> person.getAge() >= 15 && person.getAge() <= 50 && person.getGender() == Person.Sex.FEMALE); + } +} + diff --git a/src/main/java/rocks/zipcode/Person.java b/src/main/java/rocks/zipcode/Person.java new file mode 100644 index 0000000..78dcb10 --- /dev/null +++ b/src/main/java/rocks/zipcode/Person.java @@ -0,0 +1,87 @@ +package rocks.zipcode; + +import java.time.LocalDate; +import java.time.Period; + +public class Person { + + + public enum Sex { + MALE, FEMALE + } + + String name; + LocalDate birthday; + Sex gender; + String emailAddress; + + public Person() { + this.name = ""; + this.birthday = LocalDate.now(); + this.gender = null; + this.emailAddress = ""; + } + + public Person(String name, LocalDate birthday, Sex gender, String emailAddress) { + this.name = name; + this.birthday = birthday; + this.gender = gender; + this.emailAddress = emailAddress; + } + + public int getAge() { + return Period.between(birthday, LocalDate.now()).getYears(); + } + + // ... + public String toString() { + return "Person = " + name + + ", birthday = " + birthday + + ", gender = " + gender + + ", Age = " + getAge() + + ", emailAddress = " + emailAddress + "\n"; + } + public void printPerson(){ + System.out.println(this.toString()); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public LocalDate getBirthday() { + return birthday; + } + + public void setBirthday(LocalDate birthday) { + this.birthday = birthday; + } + + public Sex getGender() { + return gender; + } + public String getEmailAddress() { + return emailAddress; + } + + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + /*public Person createRandomPerson() { + String name = StringUtils.capitalizeFirstChar(RandomUtils.createString('a', 'e', 3)); + String[] aliases = RandomUtils.createStrings('a', 'z', 3, 5); + boolean isMale = RandomUtils.createBoolean(50); + long personalId = System.nanoTime(); + LocalDate birthDate = RandomUtils.createDate(1950, 2010); + + Person randomPerson = new Person(name, isMale, personalId, birthDate, aliases); + return randomPerson; + */ +} + + diff --git a/src/main/java/rocks/zipcode/Searches.java b/src/main/java/rocks/zipcode/Searches.java new file mode 100644 index 0000000..663bf2f --- /dev/null +++ b/src/main/java/rocks/zipcode/Searches.java @@ -0,0 +1,7 @@ +package rocks.zipcode; + +public class Searches { + + + +} diff --git a/src/main/java/rocks/zipcode/SocialNetworks.java b/src/main/java/rocks/zipcode/SocialNetworks.java new file mode 100644 index 0000000..e0d7440 --- /dev/null +++ b/src/main/java/rocks/zipcode/SocialNetworks.java @@ -0,0 +1,29 @@ +package rocks.zipcode; + +import java.util.ArrayList; +import java.util.List; + +public class SocialNetworks { + Listnetwork; + + public SocialNetworks(){ + this.network = new ArrayList<>(); + } + + public List getNetwork() { + return network; + } + + public SocialNetworks(Person person){ + this.network = new ArrayList<>(); + network.add(person); + } + public void add(Person person){ + network.add(person); + } + public List get(){ + return network; + } + + +} diff --git a/src/test/java/rocks/zipcode/PersonTest.java b/src/test/java/rocks/zipcode/PersonTest.java new file mode 100644 index 0000000..e25fa4e --- /dev/null +++ b/src/test/java/rocks/zipcode/PersonTest.java @@ -0,0 +1,98 @@ +package rocks.zipcode; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.time.LocalDate; + +public class PersonTest { + + @Before + public void setUp() { + Person person1 = new Person("Brian", LocalDate.of(1986, 8, 30), Person.Sex.MALE, "email1@address.com"); + Person person2 = new Person("Rando", LocalDate.of(1999, 5, 05), Person.Sex.FEMALE, "random@email.com"); + } + + @Test + public void getAge() { + Person person1 = new Person("Brian", LocalDate.of(1986, 8, 30), Person.Sex.MALE, "email1@address.com"); + Person person2 = new Person("Rando", LocalDate.of(1999, 5, 05), Person.Sex.FEMALE, "random@email.com"); + int actual = person1.getAge(); + int expected = 33; + Assert.assertEquals(expected, actual); + + } + + @Test + public void printPerson() { + } + + @Test + public void getName() { + Person person1 = new Person("Brian", LocalDate.of(1986, 8, 30), Person.Sex.MALE, "email1@address.com"); + Person person2 = new Person("Rando", LocalDate.of(1999, 5, 05), Person.Sex.FEMALE, "random@email.com"); + String actual = person1.getName(); + String expected = "Brian"; + Assert.assertEquals(expected, actual); + + } + + @Test + public void setName() { + Person person1 = new Person("Brian", LocalDate.of(1986, 8, 30), Person.Sex.MALE, "email1@address.com"); + Person person2 = new Person("Rando", LocalDate.of(1999, 5, 05), Person.Sex.FEMALE, "random@email.com"); + person2.setName("Muffin"); + String actual = person2.getName(); + String expected = "Muffin"; + Assert.assertEquals(expected, actual); + } + + @Test + public void getBirthday() { + Person person1 = new Person("Brian", LocalDate.of(1986, 8, 30), Person.Sex.MALE, "email1@address.com"); + Person person2 = new Person("Rando", LocalDate.of(1999, 5, 05), Person.Sex.FEMALE, "random@email.com"); + + LocalDate actual = person2.getBirthday(); + LocalDate expected = LocalDate.of(1999, 5, 05); + Assert.assertEquals(expected, actual); + } + + @Test + public void setBirthday() { + Person person1 = new Person("Brian", LocalDate.of(1986, 8, 30), Person.Sex.MALE, "email1@address.com"); + Person person2 = new Person("Rando", LocalDate.of(1999, 5, 05), Person.Sex.FEMALE, "random@email.com"); + person2.setBirthday(LocalDate.of(1998,5,20)); + LocalDate actual = person2.getBirthday(); + LocalDate expected = LocalDate.of(1998, 5, 20); + Assert.assertEquals(expected, actual); + } + + @Test + public void getGender() { + Person person1 = new Person("Brian", LocalDate.of(1986, 8, 30), Person.Sex.MALE, "email1@address.com"); + Person person2 = new Person("Rando", LocalDate.of(1999, 5, 05), Person.Sex.FEMALE, "random@email.com"); + Person.Sex actual = person1.getGender(); + Person.Sex expected = Person.Sex.MALE; + Assert.assertEquals(expected, actual); + } + + @Test + public void getEmailAddress() { + Person person1 = new Person("Brian", LocalDate.of(1986, 8, 30), Person.Sex.MALE, "email1@address.com"); + Person person2 = new Person("Rando", LocalDate.of(1999, 5, 05), Person.Sex.FEMALE, "random@email.com"); + String actual = person1.getEmailAddress(); + String expected = "email@address.com"; + Assert.assertEquals(expected, actual); + } + + @Test + public void setEmailAddress() { + Person person1 = new Person("Brian", LocalDate.of(1986, 8, 30), Person.Sex.MALE, "email1@address.com"); + Person person2 = new Person("Rando", LocalDate.of(1999, 5, 05), Person.Sex.FEMALE, "random@email.com"); + person1.setEmailAddress("emailz@address.com"); + String actual = person1.getEmailAddress(); + String expected = "emailz@address.com"; + Assert.assertEquals(expected, actual); + } +} diff --git a/src/test/java/rocks/zipcode/SearchesTest.java b/src/test/java/rocks/zipcode/SearchesTest.java new file mode 100644 index 0000000..206d0c0 --- /dev/null +++ b/src/test/java/rocks/zipcode/SearchesTest.java @@ -0,0 +1,57 @@ +package rocks.zipcode; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.contrib.java.lang.system.SystemOutRule; + +import java.time.LocalDate; + +public class SearchesTest { + SocialNetworks networks = new SocialNetworks(); + + + @Before + public void setUp() { + Person person1 = new Person("Brian", LocalDate.of(1986, 8, 30), Person.Sex.MALE, "email1@address.com"); + Person person2 = new Person("Rando", LocalDate.of(1999, 11, 10), Person.Sex.FEMALE, "random@email.com"); + Person person3 = new Person("Peoples", LocalDate.of(1983, 6, 20), Person.Sex.MALE, "email30@address.com"); + Person person4 = new Person("Jojo", LocalDate.of(1972, 5, 5), Person.Sex.FEMALE, "random2@email.com"); + Person person5 = new Person("Faye", LocalDate.of(1994, 2, 14), Person.Sex.MALE, "email25@address.com"); + Person person6 = new Person("Boberto", LocalDate.of(2003, 4, 21), Person.Sex.FEMALE, "random45@email.com"); + Person person7 = new Person("Guy", LocalDate.of(1969, 1, 3), Person.Sex.MALE, "email50@address.com"); + Person person8 = new Person("Smiley", LocalDate.of(2008, 12, 8), Person.Sex.FEMALE, "random77@email.com"); + Person[] peeps = {person1, person2, person3, person4, person5, person6, person7, person8}; + + for (int i = 0; i < peeps.length; i++) { + networks.add(peeps[i]); + } + } + + + @Rule + public final SystemOutRule systemOutRule = new SystemOutRule().enableLog(); + + @Test + public void writesTextToSystemOut() { + class Under30 implements CheckPerson { + @Override + public boolean test(Person person) { + return person.getAge() <= 30; + } + } + Main.printPersons(networks.get(), new Under30()); + String actual = "Person = Rando, birthday = 1999-11-10, gender = FEMALE, Age = 20, emailAddress = random@email.com\n\n" + + "Person = Faye, birthday = 1994-02-14, gender = MALE, Age = 25, emailAddress = email25@address.com\n\n" + + "Person = Boberto, birthday = 2003-04-21, gender = FEMALE, Age = 16, emailAddress = random45@email.com\n\n" + + "Person = Smiley, birthday = 2008-12-08, gender = FEMALE, Age = 10, emailAddress = random77@email.com\n\n"; + + Assert.assertEquals(systemOutRule.getLog(),actual); + + + } + + +} + diff --git a/src/test/java/rocks/zipcode/SocialNetworksTest.java b/src/test/java/rocks/zipcode/SocialNetworksTest.java new file mode 100644 index 0000000..03f7952 --- /dev/null +++ b/src/test/java/rocks/zipcode/SocialNetworksTest.java @@ -0,0 +1,39 @@ +package rocks.zipcode; + +import org.junit.Before; +import org.junit.Test; + +import java.time.LocalDate; +import java.util.ArrayList; + +public class SocialNetworksTest { + SocialNetworks networks = new SocialNetworks(); + LocalSearch search = new LocalSearch(); + + + @Before + public void setUp() { + Person person1 = new Person("Brian", LocalDate.of(1986, 8, 30), Person.Sex.MALE, "email1@address.com"); + Person person2 = new Person("Rando", LocalDate.of(1999, 11, 10), Person.Sex.FEMALE, "random@email.com"); + Person person3 = new Person("Peoples", LocalDate.of(1983, 6, 20), Person.Sex.MALE, "email30@address.com"); + Person person4 = new Person("Jojo", LocalDate.of(1972, 5, 5), Person.Sex.FEMALE, "random2@email.com"); + Person person5 = new Person("Faye", LocalDate.of(1994, 2, 14), Person.Sex.MALE, "email25@address.com"); + Person person6 = new Person("Boberto", LocalDate.of(2003, 4, 21), Person.Sex.FEMALE, "random45@email.com"); + Person person7 = new Person("Guy", LocalDate.of(1969, 1, 3), Person.Sex.MALE, "email50@address.com"); + Person person8 = new Person("Smiley", LocalDate.of(2008, 12, 8), Person.Sex.FEMALE, "random77@email.com"); + Person[] peeps = {person1, person2, person3, person4, person5, person6, person7, person8}; + for (int i = 0; i < peeps.length; i++) { + } + for (int i = 0; i < peeps.length; i++) { + networks.add(peeps[i]); + } + } + + @Test + public void searchTest1() { + LocalSearch.printPersons(networks.get(), search); + + + } + +} \ No newline at end of file