write unit test for a method which make calls to other private methods of the same class in java. how to mock private method
Should I test private methods or only public ones?
I came across this problem and I believe Lagrange's theorem is the key to its solution.  The question is:     Let $p$ be an odd prime. Prove that there is some integer $x$ such that $x^2 \equiv −1 \pmod p$ if and only if $p \equiv 1 \pmod 4$.   I appreciate any help.  Thanks. Creating a new DOM element from an HTML string using built-in DOM methods or Prototype I have an HTML string representing an element: '&lt;li&gt;text&lt;/li&gt;'. I'd like to append it to an element in the DOM (a ul in my case). How can I do this with Prototype or with DOM methods?  (I know i could do this easily in jQuery, but unfortunately we're not using jQuery.) Is it possible to install Python 3.x in 14.04 LTS, or upgrade from Python 2.7.6 to 2.7.8? Is it okay to use the phrase "try and"? Is it grammatically correct? e.g. "I will try and answer ..." I read the following sentence in book (App).     I will try and answer any questions you ask.   Why don't they use the following? (it is much common):     I will try to answer any questions you ask.   Is there any difference in meaning?  Update:  I noticed that a lot of books and news websites are using this phrase:        Although Katty will try and answer as many questions as she can.    He puller would have a chance to try and answer the question on her own ... In cricket how does someone become an umpire at international level? Is there some procedure for this? How are they selected and what is the criteria for this? What is the purpose of the 'nobody' user? After I read  I noticed that there is a user account named 'nobody' in my Ubuntu system.   Also I noticed that I can login in this account from terminal using the following command and my password:  sudo su nobody     It doesn't mind me at all, but I want to know what is the purpose of this user? Is it created by default on a fresh install of Ubuntu or is created by installing a particular package? youtube-dl failed to extract signature How can one predict whether an individual infected with the SARS-CoV-2 virus will be asymptomatic? According to  , half of the   virus carriers show no symptoms.   What are the biological factors that determine whether an infected individual will be asymptomatic or not? Variation of the Kempner series – convergence of series $\sum\frac{1}{n}$ where $9$ is not a digit of $1/n$. It is easy to argue that the  converges:  $$  \sum\limits_{\substack{n \text{ s.t. 9 is}\\\text{ not a digit} \\\text{ of } n}}  \frac{1}{n} &lt; \infty$$  Let $E \subset \Bbb N_{&gt;0}$  the subset of the positive integers  such that $9$ is not a digit of the decimal expansion of $1/n$ (the decimal expansion is not allowed to have a trailing infinite sequence of "$9$"s. For instance $0.24999...$ is not allowed).  Here are the  that don't belong to $E$ : $11,13,17,19,21,23,29,31,34,38,41,…$ (not known by the OEIS, by the way).  My question is:     Does the series    $$ \sum\limits_{n \in E} \frac{1}{n} \tag 1$$ converge?   My attempt is :   Let $1/n = 0,a_1 a_2 \dots a_k \overline{b_1 b_2 \dots b_m}$ with $n \in E$. Since $1/n$ has no digit "9", we have at most $9^{k+m}$ possibilities for the $a_i$'s and $b_j$'s. Moreover, $1/n ≥ 0,00...0\overline{00...01}≥1/10^{k+m}$. But then I can only bound my series $(1)$ from below, by some real number. So, this is not a clue for the divergence of the series. Apparently, the numbers of the form $n=10k+1$ don't belong to $E$. Maybe we can find sufficiently many numbers that have $9$ in the decimal representation of their reciprocals, so that $(1)$ could converge...   Any comment will be appreciated ! I would like to format a price in JavaScript. I'd like a function which takes a float as an argument and returns a string formatted like this: &quot;$ 2,500.00&quot;  What's the best way to do this? How could I retrieve the exact duplicate value from conditionally formatted list that highlight duplicates? I have imported a webpage table in to Google Sheets. It frequently being updated. A series of calculations has been conducted on the sheet named Shawn Of the link spreadsheet.  I have filtered the my desired results into the Calculation sheet of that linked document... which is in columns A5:A. I then applied =ARRAYFORMULA(if(A5:A200=&quot;&quot;,,A5:A200*{12,13,37,101,111})) in columns B5. The Results of the formula extends from B5:F. This results from a5:F was subsequently conditionally formatted to highlighted duplicates in the aforementioned, i.e. a5:f using the lists of values in K5:K and I5:5. In Columns A5:F, is it possible to generate/place values in the range A5:f with matching name of states and aligned values in J5:K and H5:I? In Python, you can do this:  import webbrowser webbrowser.open_new("http://example.com/")   It will open the passed in url in the default browser  Is there a ruby equivalent? This question led to a new package:      How can I display the full path of the tex file that I compile? It is a simple file, no include or input present.  Edit: I use MiKTeX 2.9 on a Windows 7 64-bit.  Less demanding: If not possible, then I will be satisfied with a partial path (at least one or two folders up + the filename). Equivalent of String.format in jQuery I have a sqlite (v3) table with this column definition:  "timestamp" DATETIME DEFAULT CURRENT_TIMESTAMP   The server that this database lives on is in the CST time zone.  When I insert into my table without including the timestamp column, sqlite automatically populates that field with the current timestamp in GMT, not CST.  Is there a way to modify my insert statement to force the stored timestamp to be in CST?  On the other hand, it is probably better to store it in GMT (in case the database gets moved to a different timezone, for example), so is there a way I can modify my select SQL to convert the stored timestamp to CST when I extract it from the table? can I change value of $_SERVER['DOCUMENT_ROOT']? Create Random Number Sequence with No Repeats Duplicate:    I want an pseudo random number generator that can generate numbers with no repeats in a random order. For example: random(10) might return 5, 9, 1, 4, 2, 8, 3, 7, 6, 10 Is there a better way to do it other than making the range of numbers and shuffling them about, or checking the generated list for repeats?  Edit: Also I want it to be efficient in generating big numbers without the entire range.  Edit: I see everyone suggesting shuffle algorithms. But if I want to generate large random number (1024 byte+) then that method would take alot more memory than if I just used a regular RNG and inserted into a Set until it was a specified length, right? Is there no better mathematical algorithm for this. Point Renderings Slightly Off in Mathematica What geometric object is given by this equation? I have a question about the following problem from a Putnam review:  Let $n\in \mathbb{N}$. Find how many pairs of natural numbers $(x, y)\in \mathbb{N}\times \mathbb{N}$ solve $$ \frac{xy}{x+y}=n. $$  I have found some solutions for all $n$, such as $(2n, 2n)$ and $(n+1, n(n+1))$, but I feel as though this is the wrong approach, as the question is only asking for the number of solutions to the equation.  I don't really want a complete solution, but any hints would be greatly appreciated.