I have a single method which is really comprehensive. Within this method couple of other methods are called and each method depends on the previous one.   My question is: What is the best approach to test this complex method using JUnit?  Can I just create one single @Test Method and calling the other methods within this method? For example:  @Test public void testRun(){     testMethod1();     testMethod2();     ... }  testMethod1(){ assertNotEquals(); ... }   I can´t believe that it is that easy. Wouldn´t it be better to test each method on their own? But how can I implement that? Are their any best practises?  But maybe this is the right way.  Thanks for any suggestions !:)
What is the best way to unit test a method that calls into multiple methods, for example:  modify(string value) {     if(value.Length &gt; 5)  replaceit(value);      else changeit(value); }   This pseudo code has a modify method that (currently) calls either replaceit() or changeit(). I have already wrote tests for replaceit and changeit, so writing a new test for modify will be 99% the same set of code.  I need to test it thought because it may change in the future.    So do I copy paste the existing test code?  Move the test code to a common function?  Any other ideas?  I'm not sure of the best practice here.
Is it possible to run Snow Leopard on a LATE 2011 MacBook Pro? Using getopts to process long and short command line options I wish to have long and short forms of command line options invoked using my shell script.  I know that getopts can be used, but like in Perl, I have not been able to do the same with shell.  Any ideas on how this can be done, so that I can use options like:  ./shell.sh --copyfile abc.pl /tmp/ ./shell.sh -c abc.pl /tmp/   In the above, both the commands mean the same thing to my shell, but using getopts, I have not been able to implement these? $f$ holomorphic on $D\setminus \{0\}$ and takes no values in $(-\infty,0],$ then $0$ removable If $f$ is holomorphic on $D\setminus \{0\}$ and takes no values in $(-\infty,0]$ then $0$ is a removable singularity.   I thought to prove this by elimination, but I can't really tell anything about the behavior of $f$ around $0$. How can one translate the information about the definition of $f$ in semi-open interval $(-\infty,0]$. Didn't Harry have any other family he could have searched for? You'd think that as soon as Harry met someone who was friends with his dad, he'd have asked about his family.  Certainly Lupin or Sirius could have told him something of his family, given that they were James' closest friends, and Sirius was "always welcome at the Potters".  Obviously there's nothing in the books, but did J.K. Rowling ever explain why there was no mention of any living relative other than Aunt Petunia, or even what happened to Harry's grandparents? Android reading from .txt File created in src folder transpose columns to rows On the photos where the lens flare is present, my Nikon D7000 is drawing strange labyrinth-looking artifacts. Here's an example.  The first image is a screenshot of a little part of the original photo zoomed 2:1 in Lightroom.  The second image is the same photo with Lightroom's contrast, clarity and sharpening set to the maximum to make the labyrinth pattern more visible.      This affects only some of the photos presenting lens flare. Here, for instance, the lens flare is present and light conditions are very close to the first photo, but there is no labyrinth pattern, only usual noise (screenshot of a part of a photo at 1:1 with contrast, clarity and sharpening set to the maximum):    Notes:   I can see this pattern only on some of the photos when the sun is in the frame or nearly in the frame. It is present with any lens I tested. The actual photo was shot at f/8, ISO 200, 1/640 s. I've seen this pattern in photos shot at ISO 100 as well. The photo is in RAW format, so this is not a JPEG artifact.   What is that? How do I avoid it? Benefits of Toad houses I have a few red Toads and a Toad is just hanging out in town. I see an option to buy a red Toad house, ostensibly for him. Are there any added benefits of purchasing this or are the colored Toad houses just cosmetic? Why do clocks measure arc-length? Apologies in advance for the long question.  My understanding is that in GR, massive observers move along timelike curves $x^\mu(\lambda)$, and if an observer moves from point $x^\mu(\lambda_a)$ to $x^\mu(\lambda_b)$, then his clock will measure that an amount of time $t_{ba}$ given by the curve's arc length; $$   t_{ba} = \int_{\lambda_a}^{\lambda_b}d\lambda \sqrt{-g_{\mu\nu}(x(\lambda))\dot x^\mu(\lambda)\dot x^\nu(\lambda)} $$ will have elapsed where $g_{\mu\nu}$ is a metric on spacetime with signature $(-,+,+,+)$.    Why is this so?     Here is how I would attempt to justify this fact in special relativity with $g_{\mu\nu} = \eta_{\mu\nu}$.  Consider an inertial observer $O$ in $\mathbb R^{3,1}$, and suppose that this observer sees a clock, which I'll call observer $O'$ moving around on a curve $x^\mu(\lambda)$.  If $O'$ were also an inertial observer, then given any event with coordinates $x^\mu$ as measured by $O$, observer $O'$ would measure the coordinates of the event to be $x'^\mu = \Lambda^\mu_{\phantom\mu\nu} x^\nu + x_0^\mu$ for some Lorentz transformation $\Lambda$.  If $O'$ is not inertial, then this is no longer true, and there is some more complicated family of transformations, say $T_\lambda$ between events as seen by both observers.  I would argue, however, that if we were to partition the interval $[\lambda_a, \lambda_b]$ into a large number $N$ of intervals $I_1=[\lambda_a, \lambda_i], \dots, I_N=[\lambda_{N-1}, \lambda_b]$ with $\lambda_n = \lambda_a+n\epsilon_N$ and $\epsilon_N=(\lambda_b-\lambda_a)/N$, then on each interval $I_n$, $O'$ is approximately an inertial observer in the sense that $$   T_{\lambda_n} = P_n + \mathcal O(\epsilon_N), \qquad (\star) $$ for some Poincare transformation $P_n$.  Then we would note that since $O'$ is stationary in his own reference frame, he measures his worldline to have the property $\dot x'^\mu(\lambda) = (\dot t(\lambda), \mathbf 0)$ so that $$   I_{ba}=\int_{\lambda_a}^{\lambda_b}d\lambda \,\sqrt{-\eta_{\mu\nu}\dot x'^\mu\dot x'^\mu} = \int_{\lambda_a}^{\lambda_b} d\lambda \, \sqrt{\dot t^2} = t(\lambda_b) - t(\lambda_a) = t_{ba} $$ On the other hand the integral on the left can be written as a Riemann sum using the partition above, and we can invoke ($\star$) above to get \begin{align}   I_{ba}  &amp;= \lim_{N\to\infty}\left[\sum_{n=1}^N \epsilon_N\sqrt{-\eta_{\mu\nu}\dot x'^\mu(\lambda_n)\dot x'^\nu(\lambda_n)}\right] \notag\\ &amp;= \lim_{N\to\infty}\left[\sum_{n=1}^N \epsilon_N\sqrt{-\eta_{\mu\nu}\dot x^\mu(\lambda_n)\dot x^\nu(\lambda_n)} + \mathcal{O}(\epsilon_N^2)\right] \notag\\ &amp;= \int_{\lambda_a}^{\lambda_b}d\lambda \,\sqrt{-\eta_{\mu\nu}\dot x^\mu\dot x^\mu} \end{align} Combining these two computations gives the desired result.  How do others feel about this argument?  I'm not completely comfortable with it because of the assumption $(\star)$ I made on $T_\lambda$.  I imagine that in GR a similar argument could be made by invoking local flatness of the metric. Are mounts proficient in armour (barding)? Airbnb housing gone electrifyingly bad I am staying at a place booked via Airbnb. Something happened and there is no electricity from Friday! The house-owner has provided a super noisy generator, which is inconsistent, meaning that it "randomly" supplies power to some parts of the house, so you cannot rely on it.  Is there any rule/law in SF, CA, USA to describe the compensation one should get from such kind a situation?    The owner owns the whole building. On the ground floor there is a restaurant. On the 1st floor there are the apartments. Something happened in the restaurant, which made the electricity go off, but she didn't give more details, she said "there was an emergency and the power went off". Do I need an airport transit visa for Dublin, Ireland en route to the UK? I am Haitian, and traveling with a Haitian passport. I have to go to London with a work permit (tier 2 visa) on the 29th of July but I have 2 hour transit in Dublin.  Do I need a transit visa? Can I get it at the airport?  I also have a valid US visa. Should I wait for a recession to buy a home? I am currently renting, but am considering buying a house in the future (1-3 years). I want to know if I should even consider waiting for a future recession to buy a home at a better price. Some would argue that we are due for a recession (seems common enough to not need a reference), though none of us can know this is imminent with certainty.   I would not mind waiting to buy if it means my money would go further. However, if I wait and the market does not come down, I risk the inverse as the cost of homes in my area is rising faster than inflation.  All other considerations aside, should I wait for a recession to buy a home and what other risks does this carry? Keep processes running after SSH session disconnects I sometimes have long running processes that I want to kick off before going home, so I create a SSH session to the server to start the process, but then I want to close my laptop and go home and later, after dinner, I want to check on the process that I started before leaving work. How can I do that with SSH? My understanding is that if you break your SSH connection you will also break your login session on the server, therefore killing the long running process. What are the minimum requirements to run Windows 10? Is there a word for the sadness over "What might have been"? A novel where a woman from "future" of 1999 speaks leet-speak I'm trying to remember the name of a novel/series I read back in the mid-eighties.  I can't remember the author other than that it was a known older author.  I initially thought maybe Saberhagen or Harrison, but can't find it in their bibliographies.  It involved a collection of 4-5 people from different times/places.  The distinctive bit I can remember was that one of them (not the main character) was a cyberpunkish woman from the "future" of 1999 who spoke in futuristic dialect of English that the other characters, including the protagonist, from the "present" (from the eighties) could not understand.  Unfortunately, I don't remember much else of the plot other than that they were making their way through ruins. So, through typing several commands I've found that there's not only ls, but l and la too. There doesn't appear to be any man entries on Ubuntu 12.14. They all appear to do similar things with minor differences:  $ ls app        config     CONTRIBUTING.md  doc       Gemfile       Guardfile  LICENSE  MAINTENANCE.md  Procfile  Rakefile   script  tmp     VERSION CHANGELOG  config.ru  db               features  Gemfile.lock  lib        log      PROCESS.md      public    README.md  spec    vendor $ la app      CHANGELOG  config.ru        db   features  Gemfile       .git        Guardfile  LICENSE  MAINTENANCE.md  Procfile  Rakefile   .rspec  .secret     spec  .travis.yml  VERSION .bundle  config     CONTRIBUTING.md  doc  .foreman  Gemfile.lock  .gitignore  lib        log      PROCESS.md      public    README.md  script  .simplecov  tmp   vendor $ l app/       config/    CONTRIBUTING.md  doc/       Gemfile       Guardfile  LICENSE  MAINTENANCE.md  Procfile  Rakefile   script/  tmp/     VERSION CHANGELOG  config.ru  db/              features/  Gemfile.lock  lib/       log/     PROCESS.md      public/   README.md  spec/    vendor/   Just as a bit of trivia, are there more of these and what do they do? Is here any place to find this out? Unfortunately, google searching these commands gets ignored because they're so short. How do I code a table to look like this? I'm not the best at LaTeX and can't seem to wrap my head around \multirow. I checked other examples prior to posting but they used \multicolumn and it just confused me even more. Thanks in advance!    \begin{center} \begin{tabular}{ |c|c|c|c|c|}   \hline  TextA &amp; TextB &amp; TextC &amp; TextD &amp; TextE\\  \hline  A &amp; TextF &amp; TextG &amp; TextH &amp; TextI\\  B &amp; TextJ &amp; TextK &amp; TextL &amp; TextM\\  C &amp; \multirow{2}*{TextF} &amp; TextG &amp; TextH &amp; TextI\\  \cline{3-3}  &amp; TextJ &amp; TextK \\ \hline \end{tabular} \end{center}   I was trying something like this.. I'm starting to have problems as I'm trying to multirow within a multirow? I'm not sure of the process here. I would like TextG to be split into 2 and TextH and TextI to be the cells which are split in 3 but not sure how to go about it. Will then TextJ and TextK be the contents of the split TextG cell? I would like to know if there is a word or phrase for a systematic campaign to annihilate every descendant of a particular ancestor.   We have the word 'genocide' for killing off an entire race, and plenty of words for killing people based on how they are related to you (fratricide, filicide, et. al.), but looking over the  and the , I couldn't find a term for systematically killing an entire bloodline.   My question is prompted by a US news story about the horrific murder of 8 members of the same family, but those murders are not an example of what I'm thinking of because the children of the victims were left alive, so the motive for the killings was not to kill off the bloodline. The sense that some group had coordinated an attack against just one family is what made me wonder what the "not an entire race, just one bloodline" version of 'genocide' would be called.   Searching the Internet for "kill off" and bloodline sends me straight into the land of vampires, Illuminati, reptilian overlords, and, naturally, Priory of Sion nonsense so I haven't had much luck finding a thread to pull.   It may be that there is no word for it in the sense of murdering a human bloodline, because we just don't attempt kill off our royals down to the last heir often enough to coin a term for it. Maybe there is a scientific term for culling a line from a test population as part of biological research?